$\textcolor{red}{This\ is\ a\ Big\ Title}$

Classification of patterns

The most basic and low-level patterns are often called idioms. They usually apply only to a single programming language.

The most universal and high-level patterns are architectural patterns. Developers can implement these patterns in virtually any language. Unlike other patterns, they can be used to design the architecture of an entire application.

In addition, all patterns can be categorized by their intent, or purpose. The three main groups of patterns:

  • Creational patterns provide object creation mechanisms that increase flexibility and reuse of existing code.
  • Structural patterns explain how to assemble objects and classes into larger structures, while keeping the structures flexible and efficient.
  • Behavioral patterns take care of effective communication and the assignment of responsibilities between objects.

Gang of Four Design Patterns

Creational Design Patterns

  1. Abstract Factory Allows the creation of objects without specifying their concrete type.
  2. Builder Uses to create complex objects.
  3. Factory Method Creates objects without specifying the exact class to create.
  4. Prototype Creates a new object from an existing object.
  5. Singleton Ensures only one instance of an object is created.

Structural Design Patterns

  1. Adapter Allows for two incompatible classes to work together by wrapping an interface around one of the existing classes.
  2. Bridge Decouples an abstraction so two classes can vary independently.
  3. Composite Takes a group of objects into a single object.
  4. Decorator Allows for an object’s behavior to be extended dynamically at run time.
  5. Facade Provides a simple interface to a more complex underlying object.
  6. Flyweight Reduces the cost of complex object models.
  7. Proxy Provides a placeholder interface to an underlying object to control access, reduce cost, or reduce complexity.

Behavior Design Patterns

  1. Chain of Responsibility Delegates commands to a chain of processing objects.
  2. Command Creates objects which encapsulate actions and parameters.
  3. Interpreter Implements a specialized language.
  4. Iterator Accesses the elements of an object sequentially without exposing its underlying representation.
  5. Mediator Allows loose coupling between classes by being the only class that has detailed knowledge of their methods.
  6. Memento Provides the ability to restore an object to its previous state.
  7. Observer Is a publish/subscribe pattern which allows a number of observer objects to see an event.
  8. State Allows an object to alter its behavior when its internal state changes.
  9. Strategy Allows one of a family of algorithms to be selected on-the-fly at run-time.
  10. Template Method Defines the skeleton of an algorithm as an abstract class, allowing its sub-classes to provide concrete behavior.
  11. Visitor Separates an algorithm from an object structure by moving the hierarchy of methods into one object.