CSharp - An Introduction to Design Patterns

Introduction

A design pattern is a general reusable solution for commonly occurring problems.

Design Patterns is to make a template of how to solve a problem that can be used in many different situations.

Creational patterns abstract the instantiation process. The following five patterns are in this category.

  • Singleton pattern
  • Prototype pattern
  • Factory Method pattern
  • Builder pattern
  • Abstract Factory pattern

Structural patterns focus on how classes and objects can be composed to form relatively large structures. The following seven patterns fall into this category.

  • Proxy pattern
  • Flyweight pattern
  • Composite pattern
  • Bridge pattern
  • Facade pattern
  • Decorator pattern
  • Adapter pattern

Behavioral patterns is about algorithms and the assignment of responsibilities among objects. The following eleven patterns fall into this category.

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