Creational
Creation patterns help when object construction rules and configuration are becoming too tangled for constructors alone.
GoF patterns are most helpful after you already understand responsibilities, principles, process, UML, and anti-patterns. At that point, patterns stop looking like abstract names and start looking like reusable responses to recurring design pressure. This catalog is organized to support that kind of judgment rather than memorization.
In the Order Management domain, object creation, integration boundaries, optional behavior, workflow variation, and state-driven logic all appear naturally. GoF patterns matter because they offer repeatable structural moves when those pressures become real.
The GoF catalog is best treated as a toolbox of recurring responses rather than as a syllabus of patterns to memorize. Each pattern earns its place because a recurring problem shows up across systems: object creation becomes awkward, variation grows, collaborators become too entangled, or behavior needs to shift more cleanly than conditionals allow.
For Java developers, GoF patterns are especially useful because the language and ecosystem make these pressures very visible. Interfaces, composition, runtime wiring, and workflow-heavy services all create opportunities where a pattern can either reduce complexity or introduce needless indirection.
The real skill is not naming a pattern after the fact. It is recognizing when the forces in front of you match the problem the pattern was meant to solve.
Creation patterns help when object construction rules and configuration are becoming too tangled for constructors alone.
Structural patterns help when integration, composition, wrappers, or interface alignment are becoming design concerns.
Behavioral patterns help when variation in workflow, communication, state, or request handling becomes central to the design.
package org.javaomnibus.ecommerce.gof;
public final class PlaceOrderUseCase {
private final PaymentGatewayFactory paymentGatewayFactory;
private final DiscountPolicy discountPolicy;
private final NotificationPublisher notificationPublisher;
public PlaceOrderUseCase(
PaymentGatewayFactory paymentGatewayFactory,
DiscountPolicy discountPolicy,
NotificationPublisher notificationPublisher
) {
this.paymentGatewayFactory = paymentGatewayFactory;
this.discountPolicy = discountPolicy;
this.notificationPublisher = notificationPublisher;
}
public OrderReceipt handle(Order order) {
PaymentGateway paymentGateway = paymentGatewayFactory.forMethod(order.paymentMethod());
Money finalTotal = discountPolicy.apply(order, order.total());
paymentGateway.authorize(finalTotal);
notificationPublisher.publishOrderConfirmed(order);
return new OrderReceipt(order.id());
}
}
The catalog below connects each GoF pattern back to the OOAD concept that most strongly explains its shape. The bold idea is not that a pattern uses only one pillar; it is that every pattern has a dominant design mechanism and a few supporting concepts. That gives you traceability in both directions: from OOAD concept to pattern, and from pattern back to the design force it addresses.
| OOAD concept | What it mainly explains | Primary GoF patterns | Read deeper |
|---|---|---|---|
| Composition | Assembling behavior from collaborators instead of growing rigid inheritance trees. | Abstract Factory, Builder, Adapter, Bridge, Composite, Decorator, Proxy, Chain of Responsibility, Observer, State, Strategy | Inheritance vs Composition |
| Inheritance | Specializing a stable parent contract or algorithm skeleton through subclasses and overrides. | Factory Method, Interpreter, Template Method | Inheritance vs Composition |
| Encapsulation | Protecting invariants, hiding internal representation, and placing state transitions behind boundaries. | Singleton, Facade, Flyweight, Command, Iterator, Memento, Mediator | Abstraction and Encapsulation |
| Abstraction | Depending on contracts and roles instead of concrete classes or subsystem details. | Factory Method, Abstract Factory, Bridge, Facade; supports most interface-driven patterns | Interfaces and Abstract Classes |
| Polymorphism | Letting runtime types, strategies, visitors, or cloned prototypes supply behavior behind a stable call. | Visitor, Prototype; supports Strategy, State, Command, Observer, Adapter, Decorator, and many others | Polymorphism in Depth |
| Pattern | Family | Type lens | Defining OOAD concept | Supporting concepts | Details |
|---|---|---|---|---|---|
| Factory Method | Creational | Noun: maker | Inheritance | Polymorphism, Abstraction | Open |
| Abstract Factory | Creational | Noun: kit | Composition | Polymorphism, Abstraction | Open |
| Builder | Creational | Noun: assembler | Composition | Encapsulation | Open |
| Prototype | Creational | Noun: exemplar | Polymorphism | Encapsulation | Open |
| Singleton | Creational | Noun: the one | Encapsulation | Controlled construction | Open |
| Adapter | Structural | Adjective: compatible | Composition | Polymorphism | Open |
| Bridge | Structural | Noun: spanner | Composition | Abstraction, Polymorphism | Open |
| Composite | Structural | Noun: tree | Composition | Polymorphism | Open |
| Decorator | Structural | Adjective: wrapped | Composition | Polymorphism | Open |
| Facade | Structural | Noun: front door | Encapsulation | Abstraction | Open |
| Flyweight | Structural | Adjective: shared | Encapsulation | Identity/state separation | Open |
| Proxy | Structural | Adjective: stand-in | Composition | Polymorphism | Open |
| Chain of Responsibility | Behavioral | Verb: pass | Composition | Polymorphism | Open |
| Command | Behavioral | Noun from verb | Encapsulation | Polymorphism | Open |
| Interpreter | Behavioral | Verb: evaluate | Inheritance | Polymorphism | Open |
| Iterator | Behavioral | Verb: traverse | Encapsulation | Polymorphism | Open |
| Mediator | Behavioral | Verb: coordinate | Encapsulation | Composition | Open |
| Memento | Behavioral | Noun: snapshot | Encapsulation | State capture | Open |
| Observer | Behavioral | Verb: notify | Composition | Polymorphism | Open |
| State | Behavioral | Verb: behave-as | Composition | Polymorphism | Open |
| Strategy | Behavioral | Verb: do it this way | Composition | Polymorphism | Open |
| Template Method | Behavioral | Verb: procedure | Inheritance | Polymorphism | Open |
| Visitor | Behavioral | Verb: operate | Polymorphism | Double dispatch | Open |
Creation-focused patterns for object assembly, variation, and construction choices.
Wrapper, composition, and interface-shaping patterns for integration and system boundaries.
Workflow, collaboration, and runtime-behavior patterns for policies, state, notifications, and request flows.
Start with Creational when object construction hurts, Structural when wrappers or subsystem boundaries hurt, and Behavioral when workflow or collaboration logic becomes the problem. All three GoF families are now live in this vertical.
Pattern catalogs can create false confidence if a team treats them as solutions in search of problems. Use the catalog as a diagnostic map, not as a mandate to abstract aggressively.