## GoF Design Patterns While GRASP patterns can help guide the assignment of responsibilities within a system, design patterns from the GoF (Gang of Four) book provide proven solutions to common design problems within those responsibilities at the class or object level. GoF design patterns give us real solutions to code problems but aren't fixed implementations, so they're still open to interpretation. We use them to architect our software systems, matching the right shapes to fit the needs of our software. Many of these patterns are used by frameworks and professionals in huge corporations, which ties in with another pretty unique benefit—the benefit of creating a universal vocabulary of programming. There are three distinct types of design patterns: 1. **Creational Patterns:** help us make and control new object instances, such as the factory method pattern, which turns a bunch of requirements into different modules that follow the same interface but aren't necessarily the same type. Others include: - Abstract Factory - Builder - Dependency Injection - Lazy Instantiation - Multiton - Object Pool - Prototype - RAII - Singleton 2. **Structural Patterns:** concerned with how we organize and manipulate our objects, such as the adapter pattern, to wrap a module and adapt its interface to one that another module needs. Others include: - Bridge - Composite - Decorator - Delegation - Extension Object - Facade - Flyweight - Front Controller - Marker - Module - Proxy - Translator - Twin 3. **Behavioral Patterns:** focus on how code functions and handles communication with other parts of the code, such as using the observer pattern to publish and subscribe to a stream of messages in an event-based architecture. Others include: - Blackboard - Chain of Responsibility - Command - Fluent Interface - Interpreter - Iterator - Memento - Null Object - Servant - Specification - State - Strategy - Template Method - Visitor