Edocti Training
Design Patterns in Modern Java (GoF)
Scheduled sessions
No sessions are available at the moment.
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