How are the Gang of Four patterns categorized?

Answer

The 23 GoF patterns are divided into three categories based on their purpose. Creational patterns (5) deal with object creation: Singleton, Factory Method, Abstract Factory, Builder, Prototype. Structural patterns (7) deal with composing classes and objects: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy. Behavioral patterns (11) deal with communication and responsibility between objects: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor. Creational patterns abstract the instantiation process; structural patterns assemble objects into larger structures; behavioral patterns define how objects cooperate to carry out complex tasks.