Edocti
Advanced Technical Training for the Software Engineer of Tomorrow
Edocti Training

Design Patterns in Modern Java (GoF)

Intermediate
21 h
4.8 (63 reviews)

Scheduled sessions

No sessions are available at the moment.
Design Patterns in Modern Java (GoF)

Modern Java Design Patterns: Master the classic Gang of Four (GoF) patterns and learn how to implement them cleanly using modern Java (8 to 21) language features.

Get intensive hands-on practice implementing creational, structural, and behavioral patterns in real-world scenarios.

Learn how to leverage Java Streams, Lambdas, Records, and Functional Interfaces to simplify and modernize your code architecture.

Gain practical experience: ~70% of the training is dedicated to refactoring legacy code and building extensible, robust projects from scratch.

How this helps: Dramatically improve the maintainability, readability, testability, and scalability of your Java applications.

Who it’s for: Java developers aiming to elevate their software design and architecture skills.

The course also includes optional modules covering modern architectural alternatives, Dependency Injection, and recognizing anti-patterns.

Skills You Will Learn

GoF Design Patterns Creational Patterns Structural Patterns Behavioral Patterns Code Refactoring Modern Java (8-21) Functional Interfaces Architecture & Testing

Curriculum

Day 1 — Foundations & Creational patterns

  • Modern Java for patterns: records, sealed classes, pattern matching (instanceof/switch), var, modules (JPMS)
  • Generics and variance; immutability; equals/hashCode/toString; Optional do’s & don’ts
  • Factory Method — intent, UML, test-first implementation; variation with switch on enum; pattern matching switch
  • Abstract Factory — interface-based families; object composition vs. reflection; wiring via modules
  • Builder — fluent API; immutable objects with records; validation and staged builders
  • Prototype — copy strategies; deep vs. shallow; copy constructors vs. serialization; records & withers
  • Singleton — enum-based, lazy holder; testing and lifecycle; avoiding hidden global state

Day 2 — Structural patterns

  • Adapter — class vs. object adapters; mapping legacy APIs; default methods as adapters
  • Bridge — decouple abstraction/implementation; when to prefer composition over inheritance
  • Composite — uniform treatment of parts and wholes; safe vs. transparent composites; iteration with streams
  • Decorator — behavior layering; differences vs. inheritance; records for small decorators
  • Facade — simplify subsystems; module boundaries and package-visibility tricks
  • Flyweight — memory sharing; interning; value-based classes; pitfalls with mutability
  • Proxy — static vs. dynamic proxies; caching, security, remote invocation; virtual proxies with lazy loading

Day 3 — Behavioral patterns & concurrency

  • Strategy — replace conditionals; lambdas and functional interfaces; composing strategies
  • Template Method — hooks vs. default methods; when to replace with Strategy
  • State — sealed class hierarchies for explicit states; transition tables
  • Chain of Responsibility — pipelines; Optional and Try-like results; stream-based chains
  • Command — undo/redo; queuing and audit logging; functional command objects
  • Observer — Flow API/Reactive Streams; property change support; backpressure basics
  • Mediator — reduce coupling in GUIs/modules; event buses
  • Iterator — Iterable vs. Stream; collecting and laziness; custom Spliterator
  • Memento — snapshots with records; persistence hooks
  • Visitor — sealed hierarchies; pattern matching switch; double-dispatch alternatives
  • Interpreter — small DSLs; parsing with pattern matching; when to prefer combinators
  • Concurrency addendum — executors vs. virtual threads; CompletableFuture; structured concurrency (concepts)

Optional modules

Optional — Architectural patterns & testing

  • Dependency Injection (Jakarta CDI/Spring) — relation to patterns (Factory, Strategy, Facade)
  • Hexagonal/Ports & Adapters; layering and module boundaries (JPMS)
  • Testing patterns with JUnit 5; test doubles; approval tests for refactors

Course Day Structure

  • Part 1: 09:00–10:30
  • Break: 10:30–10:45
  • Part 2: 10:45–12:15
  • Lunch break: 12:15–13:15
  • Part 3: 13:15–15:15
  • Break: 15:15–15:30
  • Part 4: 15:30–17:30

Did you attend this course?

Your feedback is invaluable to us. Please share your experience with us and help us improve this course for future participants.

Share your feedback

Want to find out more? We are here to help!

Or email us directly at training@edocti.com.