Creational & Structural Patterns
- Creational patterns: Factory Method, Abstract Factory, Builder, Singleton (and why it's often wrong), Prototype
- Builder in practice: immutable objects, fluent APIs, Lombok @Builder
- Factory patterns in Spring: BeanFactory, FactoryBean, @Bean methods
- Structural patterns: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
- Decorator in Spring: AOP proxies, transaction and security interceptors
- Facade in practice: service layer hiding complex subsystems
- Proxy patterns: JDK dynamic proxies vs CGLIB — how Spring AOP works
- Adapter pattern: integrating third-party APIs with internal interfaces
Behavioral Patterns & Anti-Patterns
- Behavioral patterns: Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor
- Strategy pattern: replacing conditionals with polymorphism
- Observer in Spring: ApplicationEventPublisher, @EventListener
- Template Method: Spring's JdbcTemplate, RestTemplate — the pattern they use
- Command pattern: undoable operations, request queuing
- State machine patterns: Spring State Machine, explicit state vs if-else
- Pattern combinations: real-world examples where multiple patterns work together
- Anti-patterns: God Object, Anemic Domain Model, Golden Hammer — recognizing over-engineering
- Refactoring to patterns: identifying where patterns improve existing code
Developers who recognize design patterns in the frameworks they use daily, apply them deliberately when the fit is clear, and avoid them when simpler code is better.
- Identify and name GoF patterns in Spring, Java, and third-party library code
- Apply Builder, Strategy, Observer, and Template Method deliberately in new code
- Recognize when a pattern improves design vs when it adds unnecessary abstraction
- Refactor existing code toward a pattern when the problem it solves appears
Book the Design Patterns training
Well suited for mid-level Java developers building a stronger object-oriented design foundation. Works as a standalone day or before the Clean Code training.
Get in touch