Skip to content

Design Pattern

Singleton Pattern

  • Ensures that only one instance of a class can exist and provides a global point of access to it.

Factory Pattern

  • Provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created.

Abstract Factory Pattern

  • Provides an interface for creating related objects, without specifying their concrete classes.

Builder Pattern

  • Allows objects to be created step-by-step, with the ability to skip or repeat certain steps, and to produce different variations of an object.

Adapter Pattern

  • Allows objects with incompatible interfaces to work together by creating a wrapper object that translates between them.

Decorator Pattern

  • Allows behavior to be added to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.

Observer Pattern

  • Allows an object to maintain a list of its dependents and notify them automatically when it changes state.

Strategy Pattern

  • Allows different algorithms to be selected dynamically at runtime, without changing the interface of the object that uses them.

Template Method Pattern

  • Defines the skeleton of an algorithm in a superclass, but allows its subclasses to override certain steps of the algorithm without changing its structure.

Composite Pattern

  • Allows objects to be treated as a tree-like structure, with individual objects and groups of objects treated in the same way.