4D Training & Consultancy

Software Development

Object-Oriented Design and Patterns in Java

An applied design course for Java developers whose code works but resists change. Participants examine cohesion, coupling, and the SOLID principles, then work through creational, structural, and behavioural patterns as trade-offs, including the cases where a pattern costs more than it returns.

4 daysIn-house, online, or customized deliveryCorporate teams and professional groupsLevel: Intermediate

Overview

Practical learning for workplace transfer.

Pattern knowledge is usually acquired as a catalogue, and the result is predictable: factories that wrap a single constructor, strategy hierarchies with exactly one implementation, and an abstraction layer written for a second database that never arrives. Every one of those decisions is defended as good design while it quietly raises the cost of the next change. This course treats a pattern as a decision with a price. Participants refactor real Java code, name the forces that justify each structure, and practise removing patterns that no longer earn their keep, using records, sealed types, and pattern matching where the language now does the work.

Prerequisites

Working knowledge of Java syntax, classes, interfaces, and collections. Experience maintaining a Java application is an advantage.

Objectives

  • Evaluate a design by its cohesion, coupling, and the changes it makes cheap or expensive.
  • Apply the SOLID principles to Java code without inflating the class count.
  • Choose between inheritance, composition, and delegation using explicit trade-offs.
  • Implement creational and structural patterns only where construction or boundaries genuinely vary.
  • Replace classic patterns with records, sealed types, and switch pattern matching where the language now suffices.
  • Refactor an existing Java module toward a design that absorbs the next requirement.

Target audience

  • Java developers with a year or more of production experience
  • Technical leads responsible for code structure and review standards
  • Backend engineers maintaining long-lived business applications
  • Software architects validating designs before implementation begins
  • Developers preparing to break a monolithic application into modules
  • Engineers who have inherited codebases they did not design

Program outline

A clear structure for the learning journey.

Outline points are grouped in one designed block instead of being treated as separate module cards.

6modules24topics
  1. 01Design Forces: Cohesion, Coupling, and Change4 topics
    • What a design optimizes for: the changes the team expects to make next
    • Measuring cohesion and coupling on real Java classes and packages
    • Abstraction that pays for itself versus speculative generality
    • Reading an unfamiliar codebase for the design decisions nobody wrote down
  2. 02SOLID in Practice, Not in Theory4 topics
    • Single responsibility applied at module level rather than method level
    • Open-closed through extension points that are genuinely used
    • Liskov substitution and the contracts an inheritance hierarchy silently promises
    • Interface segregation and dependency inversion inside Java service code
    • Factory method and abstract factory where instantiation genuinely varies
    • Builder for wide constructors, optional fields, and validated objects
    • Singleton, its testing cost, and why dependency injection replaces it
    • Prototype and object pooling, and the common cases where neither is warranted
    • Adapter and facade for taming third-party and legacy interfaces
    • Decorator versus inheritance for layering behaviour at runtime
    • Composite for recursive structures and the traversal cost it introduces
    • Proxy for lazy loading, access control, and remote invocation
    • Strategy, and when an enum or a lambda is the better answer
    • Template method versus composition for sharing an algorithm skeleton
    • Observer, event publication, and the debugging cost of indirection
    • State, command, and visitor weighed against their maintenance burden
    • Records and sealed interfaces replacing value objects and type hierarchies
    • Switch pattern matching as an alternative to visitor and double dispatch
    • Removing a pattern safely by locating every remaining caller first
    • Closing design review on a module brought by the participants themselves

Materials provided

  • Course workbook, annotated code samples, and reference notes
  • Hands-on lab environment and starter repositories
  • Exercises, checklists, and reusable code templates
  • 4D Certificate of Completion
  • Post-course technical guidance

Training Options

Programs can be delivered in-house, online, or in a blended format depending on your team's schedule, location, and learning objectives. When an external certificate or exam is included, certification rules and fees remain under the relevant awarding body's policies, while 4D provides the training and preparation support.

Why choose 4D

4D runs this course on Java code your own team wrote, not on shapes and animals. Each day closes with a design review in which trainers and participants argue the trade-offs of a genuine module, agree which abstractions to keep, and mark the ones to remove before they harden into architecture nobody dares to touch.

Speak to 4D

Plan the right training or consultancy path for your team.

Share a few details and 4D will help route your inquiry toward corporate training, consultancy, assessment, Phoenix-enabled support, or a tailored program.