Factory Method
Delegates product creation to subclasses while preserving the workflow that uses it.
22 design patterns with plain Java and Spring Boot examples, class and sequence diagrams, interactive labs and comprehension challenges.
Delegates product creation to subclasses while preserving the workflow that uses it.
Creates families of compatible products without coupling the client to concrete classes.
Builds complex objects step by step and validates the result before returning it.
Creates objects by copying an existing instance and defines which parts of its state are duplicated.
Ensures that only one instance exists within a defined scope.
Adapts an existing interface to the contract your application needs.
Separates two independently changing dimensions and connects them through composition.
Treats individual elements and their groups uniformly within a tree.
Adds responsibilities by wrapping objects that maintain the same contract.
Provides a simple entry point to a subsystem made up of several components.
Shares repeated immutable state while keeping object-specific data separate.
Controls access to an object through a substitute with the same contract.
One request, several filters. Each link decides whether processing continues or stops.
Turns an action into an object that you can execute, store and undo.
Traverses a collection without exposing how it is stored internally.
Centralises collaboration so that objects no longer need to know about each other.
Captures a snapshot and restores it without exposing the object’s state.
Publishes a change and lets each subscriber react in its own way.
The same object responds differently depending on its current state.
One task, different algorithms. Select the appropriate one at runtime.
Defines the steps of a process while allowing only the changing steps to be specialised.
Adds operations to a stable structure without modifying its elements.