What is Gang Of Four (GOF)

Written by: Kien Hoang

The term "Gang of Four" (GoF) refers to the authors of the book "Design Patterns: Elements of Reusable Object-Oriented Software." This book, often considered a seminal work in software engineering, was written by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides — thus the "Gang of Four."

The book introduced and described 23 design patterns that have proven to be useful solutions to common software design problems. These design patterns are divided into three categories: creational, structural, and behavioral.

  1. Creational Patterns are focused on handling object creation mechanisms, trying to create objects in a manner suitable to the situation:

    • Abstract Factory

    • Builder

    • Factory Method

    • Prototype

    • Singleton

  2. Structural Patterns deal with object composition and typically identify simple ways to realize relationships between different objects:

    • Adapter

    • Bridge

    • Composite

    • Decorator

    • Facade

    • Flyweight

    • Proxy

  3. Behavioral Patterns are specifically concerned with communication between objects:

    • Chain of Responsibility

    • Command

    • Interpreter

    • Iterator

    • Mediator

    • Memento

    • Observer

    • State

    • Strategy

    • Template Method

    • Visitor

These patterns provide solutions that help reduce the complexity in code and improve code maintainability, flexibility, and robustness. Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.