Description

Design patterns differ by their complexity, level of detail, and scale of applicability to the entire system being designed.

  • 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 called architectural patterns.
    • Developers can implement these patterns in virtually any language.
    • Unlike other patterns, these can be used to design the architecture of an entire application.

In addition, the design patterns can also be categorized by their purpose into three main categories as mentioned below.

Type Description Patterns
Creational Patterns Concerned with the object creation mechanisms, which increase flexibility and reuse of existing code.
  • Defines how an object is created (or a class is instantiated).
Factory, Abstract Factory, Singleton, Prototype, and Builder
Structural Patterns Concerned about how to assemble objects and classes into larger structures, keeping the structures flexible and efficient.
  • Effectively assemble classes and objects to form a larger structure.
  • Simplify the structure by identifying the relationships between classes and objects.
Adapter, Bridge, Composite, Prototype, Decorator, Facade, Flyweight, Proxy
Behavioral Patterns Concerned with algorithms and the assignment of responsibilities between objects, making the communication between objects easy.
  • Responsibility for objects.
  • Interaction or communication between the objects.
Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor

Overall

We now understood how the design patterns are classified into different types.

Related Links