What is a Design Pattern?

What is a Pattern?

A Pattern is a solution to a problem in a context.

Context : is the situation in which the pattern applies.This should be a recurring situation

Problem : refers to the goal you are trying to achieve in this context. But it also refers to any constraints that occur in the context.

Solution : is what you are after: a general design that anyone can apply which resolves the goal and the set of constraints.

This means, a Design Pattern gives you a solution to a common recurring design problem, However,The Design Patterns are not meant to be laws or rules; they are just guidelines that you can even alter to fit to your needs

The first and the most definite Fundamental Design Pattern Catalog is GOF, There are 23 fundamental patterns in it.

Before Start Learning the Design Pattern you need to Knowing the OO basics (Abstraction,Encapsulation, Inheritance, Polymorphism) will
not make you a good designer 🙂 ,Patterns do not give you code. They give general solutions to design problemsPatterns are not invented they are discovered.

To learn patterns faster, they can be classified as,

Creational Patterns: Used to construct objects such that they can be decoupled from their implementing system.

Structural Patterns: Used to form large object structures between many disparate objects.

Behavioral Patterns: Used to manage algorithms, relationships, and responsibilities between objects.

Reference Head First Design Pattern Book

We need to use Design Patterns are a tool, which only be used when it is needed, Otherwise Heavy use of patterns will lead to complexity. Now I thing you have a clear idea about What is Design Pattern ?

Thanks, Have a great day 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s