Introduction to Design Patterns

Design Patterns

Design Patterns are general, reusable solutions to common software problems that have been tested and proven over time. They provide solutions to common problems and help developers write more maintainable, flexible, and scalable code. There are three main types of Design Patterns: Creational, Structural, and Behavioral. In this blog, I’ll try listing some of the important design patterns and their broader classification and in later blogs, we’ll try to explain them in detail.

Creational Design Patterns

Creational design patterns are a category of design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. These patterns provide various ways to create objects while hiding the creation logic, making the code more flexible and less coupled to specific classes or types.

There are five commonly recognized creational design patterns:

We’ll cover Singleton and Factory patterns in detail in upcoming posts as these are most commonly opted ones.

Structural Design Patterns

Structural design patterns are a category of design patterns that deal with object composition, providing a way to form larger, more complex structures from simple objects and classes. These patterns focus on the relationship between objects and how they can be used to form larger structures, while keeping the system flexible and easy to modify.

There are seven commonly recognized structural design patterns:

We’ll cover Facade, MVVM(Model-View-ViewModel) and Decorator patterns in detail in upcoming posts as these are most commonly opted ones.

Behavioral Design Patterns

Behavioral patterns are a category of design patterns that focus on communication between objects and how they interact to achieve a particular behavior or functionality. These patterns deal with the responsibilities of objects and the way they communicate and collaborate with each other.

There are 11 commonly recognized behavioral design patterns:

We’ll cover Observer and Pub-Sub patterns in detail in upcoming posts as these are most commonly opted ones.