The Theory Of Design Patterns In .NET

In my upcoming articles, we will look each of these patterns in depth with a clear example.

Design Pattern

Design Pattern basically provides an efficient way and architecture for developing an Application. It contains the set of criteria which helps us to build .NET Application in an efficient way. The design pattern solves the users' design problems in the right way and maintains the standard architecture in addition to the code.

About Gang of Four (GOF)

The concept of the design pattern came from the book DesignPattern : Elements of reusable Object Oriented Software. It describes the different 23 design patterns in the software development. The authors are Erich Gamma, Richard Helm, Ralp Johnson and John Vissidles. Thus, these authors are known as the Gang Of Four.

Types of Design Pattern

As I mentioned above, there are 23 design patterns, but they are categorized into three types, as follows:

  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns

Creational Patterns

Creational patterns deal with problem solving in the creation of the objects. Creational pattern tells us to instantiate the class independently.

There are five such patterns available, which are:

  1. Abstract Factory
  2. Builder
  3. Factory Method
  4. Object Pool
  5. Prototype
  6. Singleton

Structural Patterns

Structural patterns deal with the relationship between the class, objects and their compositions.

There are seven such patterns available, which are:

  1. Adapter
  2. Bridge
  3. Composite
  4. Decorator
  5. Facade
  6. Proxy
  7. Flyweight

Behavioral Patterns

Behavioral patterns provide loose coupling between the algorithm from an object and fewer dependencies in the object creation.This pattern is also explained under the command pattern.

There are eleven such patterns available, which are:

  1. Chain of responsibility
  2. Interpreter
  3. Command
  4. Iterator
  5. Mediator
  6. Memento
  7. Observer
  8. State
  9. Strategy
  10. Template Method
  11. Visitor