A Beginner’s Guide to Design Patterns

We use design patterns so that we don’t have to write repeated code again and again for same kind of problem. Design pattern is not a class or piece of code. Its a template which should be implemented based on the situation.

Design patterns are divided into following categories:-

  1. Behavioral,
  2. Creational,
  3. Structural

Behavioral pattern:

As the name explain, Behavioral patterns describe how the objects behave when they interact with each other and it focus on how objects communicate with each other.

Behavioral patterns can be divided further into following types:

Creational Pattern:

As the name explain, Creational Pattern describe how do we create objects. It hides the complexity of object creation. Creational Pattern can be further divided into following categories.

Structural Pattern:

Structural patterns are concerned with how classes and objects are composed to form larger structures. Structural Pattern can be further divided into following categories.

  • Adapter
  • Bridge
  • Composite
  • Decorator
  • Flyweight
  • Proxy