Java Best Practices and Design Patterns

Duration: 
4 days
Codes: 
516

Overview

Solve real-world software development problems, and deliver responsive applications that are fast and reliable. In this training course, you learn how to leverage Java best practices, avoid pitfalls, perform industry-standard software development techniques, use design patterns to implement proven solutions to reoccurring problems, and apply idioms and patterns to improve your Java code.

Audience

Developers, architects and those involved in Java projects who want to expand their Java programming skills and have familiarity with Java code at the level of Course 471, "Java Programming Introduction".

Skills Gained

You Will Learn How To You Will Learn How To

  • Employ best practices to build reliable and scalable Java applications
  • Effectively apply test-driven development to enhance program maintainability
  • Solve architectural problems with proven design patterns
  • Employ advanced Java APIs for multi-threaded programming

Prerequisites

Important Course Information Important Course Information Requirements: Requirements:

  • Knowledge at the level of:
    • Course 471, Java Programming Introduction
  • Three to six months of Java programming experience
  • You should be able to:
    • Understand Java classes, the inheritance model, polymorphism, and encapsulation
    • Use fundamental standard edition Java APIs
    • Apply object-oriented analysis and design, including defining classes and creating objects

Knowledge at the level of:

  • Course 471, Java Programming Introduction

Course 471 Course 471 , Java Programming Introduction

You should be able to:

  • Understand Java classes, the inheritance model, polymorphism, and encapsulation
  • Use fundamental standard edition Java APIs
  • Apply object-oriented analysis and design, including defining classes and creating objects

Course Outline

  • Effective Programming in Java
  • Clarifying the goals of best practices
  • Identifying the key characteristics of high-quality software
  • Organising classes, packages and subsystems into layers
  • Designing to the principles of S.O.L.I.D.
  • Applying Test-Driven Development

Exploiting a testing framework

  • Composing and maintaining JUnit tests
  • Taking advantage of advanced JUnit features
  • Testing in the presence of exceptions

Monitoring software health using logging libraries

  • Configuring logging with log4j and SLF4J
  • Minimising the impact of logging on performance

Creating matchers and mock objects

  • Writing custom Hamcrest matchers
  • Testing with fake objects and mocks
  • Leveraging Design Patterns

Employing common design patterns

  • Observer
  • Iterator
  • Template method
  • Strategy
  • State
  • Factory
  • Singleton
  • Data Accessor Object
  • Data Transfer Object
  • Composite
  • ServiceLocator
  • Proxy

Refactoring legacy code

  • Identifying reasons to change software
  • Clarifying the mechanics of change
  • Writing tests for legacy classes and methods
  • Extending Applications with Java Meta Programming

Improving type safety with generics and enum types

  • Creating generic classes and methods
  • Navigating generic class hierarchies
  • Implementing enum types for fixed sets of constants

Adding metadata by writing annotations

  • Leveraging the built-in and custom annotations
  • Annotating with meta-annotations

Modifying runtime behaviour with reflection

  • Retrieving class and method data dynamically
  • Flagging methods with naming conventions
  • Adding information to code with annotations
  • Assessing disadvantages of reflection
  • Tuning for Maximum Performance

Measuring and improving performance

  • Assessing response time
  • Conducting load and stress tests
  • Specifying strategies for improving performance

Exploiting garbage collectors

  • Exploring garbage collection metrics
  • Choosing appropriate algorithms for garbage collection
  • Avoiding the hazards of finalisers
  • Preventing memory leaks with reference types

Taking full advantage of threads

  • Writing reliable thread-safe code
  • Avoiding race hazards and deadlocks
  • Employing the Executors framework
  • Implementing the producer-consumer pattern and work stealing

Bulletproofing a threaded application

  • Synchronising and sharing data between threads
  • Managing the performance implications of synchronisation

Exploring alternatives to synchronisation

  • Taking advantage of the volatile modifier
  • Eliminating data sharing with ThreadLocal variables

Allocating responsibilities to components

  • Translating method calls with the adaptor pattern
  • Adding behaviour with a proxy

Centralising the creation of objects

  • Employing factories to achieve loose coupling
  • Implementing Inversion of Control (IoC)
  • Configuring the Spring IoC container with XML
  • Setting up dependency injection with annotations

Thinking about Onsite?

If you need training for 3 or more people, you should ask us about onsite training. Putting aside the obvious location benefit, content can be customised to better meet your business objectives and more can be covered than in a public classroom. It's a cost effective option.

Submit an enquiry from any page on this site, and let us know you are interested in the requirements box, or simply mention it when we contact you.

Upcoming Dates

  • GREEN This class is Guaranteed To Run.
  • SPVC - Self-Paced Virtual Class.
  • Click a Date to Enroll.
Course Location Days Cost Date
London
London4 2095 £2095 2019-01-29
Onsite
Onsite4 2095 £2095 2019-03-20
London
London4 2000 £2000 2019-04-29
London
London4 2095 £2095 2019-04-30