Creational

  1. Patterns that provide object creation mechanisms that increase flexibility and reuse of existing code.
  2. Creational design patterns are used to design the instantiation process of objects.
    1. The creational pattern uses the inheritance to vary the object creation.

Structural

  1. Structural patterns explain how to assemble objects and classes into larger structures, while keeping the structures flexible and efficient.

  2. Patterns that ease the design by identifying a simple way to realize relationships between entities.

  3. Structural patterns focus on the composition of classes and objects. They are all about how youassemble smaller pieces to form larger, more complex structures,while keeping those structures flexible and efficient.

  4. Structural class patterns use inheritance to compose interfaces or implementations.

  5. Key focus: Relationships, inheritance, and wrapping one object around another.

  6. Common Patterns: Adapter, Facade, Decorator, Composite.

  7. This pattern is particularly useful for making independently developed class libraries work together.

Behavioral

  1. Behavioral patterns take care of effective communication and the assignment of responsibilities between objects.

  2. Patterns that identify common communication patterns between objects and realize these patterns.

  3. Behavioral patterns focus on communication and the assignment of responsibilitiesbetween objects.

    1. They don’t care as much about how the objects are built or connected;
    2. they care about how those objects talk to each other and pass data around during runtime.
  4. Behavioral patterns are concerned with algorithms and the assignment of responsibilities between objects. Behavioral patterns describe not just patterns of objects or classes but also the patterns of communication between them.

  5. Behavioral object patterns use object composition rather than inheritance

  6. Some describe how a group of peer objects cooperate to perform a task that no single object can carry out by itself

NOTE

An important issue here is how peer objects know about each other. Peers could maintain explicit references to each other, but that would increase their coupling. In the extreme, every object would know about every other. The Mediator pattern avoids this by introducing a mediator object between peers. The mediator provides the indirection needed for loose coupling.

  1. Key focus: Messaging, distributing workload, and managing state or logic.

  2. Common Patterns: Observer, Strategy, Command, State.

Creational Patterns
Structural Patterns
DecoratorIs A, Has A
Behavioral Patterns
Strategy**Has a strategy interface

Interface passed to constructor, whose implementations (different algorithms / strategies) can be changed at runtime
Strategy pattern allows you to swap out behaviors on the fly at runtime.

References

  1. https://singhajit.com/design-patterns/

3 items under this folder.