The Gang of Four (GoF) organize design patterns into three groups—Creational, Structural, and Behavioral. Each group addresses a different source of complexity in software systems: object creation, object composition, and object collaboration. This page summarizes what each group solves, the trade-offs involved, and representative patterns.
Creational Patterns
Problem they solve: How to create families of related objects without coupling code to concrete classes.
Why they matter: Centralize construction logic, delay decisions about concrete types, enable configurability and testing.
Typical forces: You want to swap implementations at runtime, hide construction complexity, or enforce creation constraints (e.g., a single instance).
Consequences: Increased flexibility in collaboration; potential proliferation of small types and indirection.
Analogy: A theater director (mediator) coordinates actors, ensuring smooth interaction without requiring the actors to manage all communications themselves.
How to Choose
Creation pain? If object construction is leaking into business logic or varies by environment → consider Creational.
Integration pain? If components don’t fit together or you need to add behavior without modifying types → consider Structural.
Collaboration pain? If algorithms or workflows must vary independently of clients or many objects must coordinate → consider Behavioral.
Use this page as a map. When facing a design problem, first identify whether you are struggling with creation, composition, or collaboration, then select candidate patterns from the corresponding group for deeper study.
[1]Polymorphism: In design patterns, polymorphism allows objects of different classes to be treated as objects of a common type. This enables you to write code that can work with a variety of objects without knowing their exact class, promoting flexibility and maintainability.