Introduction to Design Patterns

In software engineering, design pattern is a practice to overcome the repeatable approach of coding in software design. It also helps in reducing the modification practice of the existing code or application architecture. It is a description or template for how to solve a problem that can be used in many different situations.

Design Pattern is nothing but actually a principle of advanced software development which defines architecting the software solution in a better way.

Benefits or Uses of Design Patterns in Software Development

Software development is not simply about programming or writing code (but in a better way). By implementing the concept of design pattern we can develop a highly scalable and easily maintainable software product. It is not only benefit to developers but also the testers. Some of the major the benefits of implementing design patterns are given below:

  1. It pace up the development process by reducing the repetitive approach.
  2. Reusability and extensibility of the already developed applications.
  3. Patterns name form a common vocabulary.
  4. Design patterns or design principles are well tested mechanism to improve the software development process.
  5. Design patterns helps in the reduction of cost in application maintenance.

All design patterns relies on design principles i.e. SOLID.

Types of Design Patterns

Design patterns are divided into three types:

  1. Creational design patterns.
  2. Structural design patterns.
  3. Behavioral design patterns.

All these three design patterns category are further divided into sub-parts. Each parts are explained in detail with examples. Please find below:

Creational Design patterns:

Creational design patterns deals with class instantiation which is also further divided into class-creation patterns and object-creational patterns. The class-creation pattern uses the concept of inheritance effectively during the class instantiation process and the object-creation pattern uses delegation effectively.

  • Abstract Factory
  • Builder
  • Factory Method
  • Object Pool
  • Prototype
  • Singleton

Structural Design patterns

Structural design pattern deals with Class and Object composition. Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality.

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

Behavioral design patterns

These design patterns are all about Class’s objects communication. Behavioral patterns are those patterns that are most specifically concerned with communication between objects.

  • Chain of responsibility
  • Command
  • Interpreter
  • Iterator
  • Mediator
  • Momento
  • Null Object
  • Observer
  • State
  • Strategy
  • Template Method
  • Visitor