Gang of Four Design Patterns


Gang of Four Design Patterns

The Gang of Four Design Patterns is the collection of 23 design patterns from the book “Design Patterns: Elements of Reusable Object-Oriented Software” by Gamma Erich (Author), Helm Richard (Author), Johnson Ralph (Author), Vlissides John (Author), Grady Booch (Foreword), first published in 1994. It’s still very relevent today.

If you are looking for a reference book on design patterns then this is the book for you. If you are new to design patterns I would recommend the book Head First Design Patterns.

Creational Patterns

The first type of design pattern is the creational pattern. Creational patterns provide ways to instantiate single objects or groups of related objects. Here are some examples of such patterns: Singleton, Abstract Factory, Builder, and Factory Method.

Structural Patterns

The second type of design pattern is the structural pattern. Structural patterns provide a manner to define relationships between classes or objects. Some examples are: Decorator, Adapter, Bridge, Facade, Flyweight, and Proxy

Behavioural Patterns

The final type of design pattern is the behavioural pattern. Behavioural patterns define manners of communication between classes and objects. Some examples are: Strategy, Command, Iterator, State, Chain of Responsibility, Momento, and Visitor.