Design patterns

Design patterns

Design patterns are very general, reusable templates for how to solve specific design problems in software design. They provide development paradigms that are tested and proven, improve code readability and the application design. Design patterns also give coders a shared language and speed up development by giving a starting point for the solution.

On the other hand, the concept of design patterns is criticized as “workarounds for the missing language features” and code duplication.

We can divide them into three categories: creational , structural and behavioral patterns.

Creational design patterns

In some situations the direct object creation can add complexity or cause design problems. Creational design patterns help solve this problem as they regard class instantiation.

Creational patterns are:

Structural design patterns

Structural design patterns regard class and object composition. They identify a simple way to realize relationships between entities and help to decide how different classes and objects are combined to form larger structures.

Structural patterns are:

  • Adapter
  • Bridge
  • Composite
  • Decorator
  • Facade
  • Flyweight
  • Private Class Data
  • Proxy

Behavioral design patterns

Behavioral design patterns regard communication between objects. They describe the way objects and classes interact and divide responsibilities among themselves.

Behavioral patterns are:

  • Chain of responsibility
  • Command
  • Interpreter
  • Iterator
  • Mediator
  • Memento
  • Null Object
  • Observer
  • State
  • Strategy
  • Template method
  • Visitor

References

Design Patterns Library – Pluralsight Online Training

http://www.sourcemaking.com

Leave a comment