Software Design Pattern

Whenever word Design Pattern comes to mind; few things automatically starts revolving in everyone's mind such as boring literature, out of world, just another interview question, only for geeks etc. We know that you have read many books,articles, blogs and other web tutorials on Design Pattern then why do you need to read one more, specifically this one. We can also feel for you if you are a beginner; as you read more about design pattern it creates more confusion in your mind.

As we always make our effort to provide best value for your time, you are putting on this blog. Keeping the same convention we have build this topic that shall provide following:

(1) Why do we need Design Pattern?
(2) What are all types of Design Pattern?
(3) Practical Use case of each Design Pattern
(4) Idea behind every pattern type
(5) Example in C++
(6) Question/Issues related with Design Pattern
(7) Your Queries.

Overview Of Design Pattern In 1994,the idea to reuse an Object/code/implementation/entity is formalized when a book titled "Design Patterns - Elements of Reusable Object-Oriented Software" is published a by four researchers well known as Gang Of Four (GOF) primarily based on principle of object oriented programming such as

(1) Encapsulation
(2) Inheritance
(3) Abstraction
(4) Polymorphism

Design Pattern is nothing but a general reusable solution of frequently occurring problems in the context of software design.

Why do we need design pattern?

In software development CHANGE is inevitable, reason of change can be anything such as enhancement or modification of customer's need, Change in technology and even the team that has built a project is changed etc. therefore following problems may always arises if project/software/code is not designed well.

(1) Rigidity:- It become very difficult to change, even in a simplest of code/module, Because that may lead to changes in other dependant modules. Ideally software shall be designed in such a way that one module can be changed independently of others.

(2) Fragility :- It is a problem of code to break-up in too many multiple parts, whenever someone either try to make some changes or fix some issues, some software are so fragile that it became impossible to maintain.

(3) Immobility:- Means, Inability to reuse a code from other projects or other part of same projects that shall increase the time and effort to develop a software.

(4) Viscosity:- it is a measurement of resistance to change for the design of notations. it can be of design itself or can be of environment

A software should be developed in such a way that it should limit above mentioned issues, and here software design comes in to the picture; well designed software overcomes above problems.

What are all types of Design Pattern?

GOF proposed 23 design patterns that can be classified in three different categories

(1) Creational Pattern:- Basic idea behind Creational pattern is to identify what all possible ways to create an object; By hiding the details of how an object is created, avoid instantiating object by directly call new operator and also provides flexibility to choose which object is created and when to create in a given situation. Following are some of the frequently used Creational Pattern
(A) Singleton Pattern
(B) Factory Pattern
(C) Abstract Factory Pattern
(D) Builder Pattern
(E) Prototype Pattern

(2) Structural Pattern:- Structural Patterns are the ones where emphasis on relationship between two entities(Objects).

(3) Behavioral Pattern:- Behavioral Patterns are the one where emphasis is on communication between two entities(Objects) and provides flexibility to communicate.

Your Comments /Suggestions and Questions are always welcome.
We shall clarify with best of knowledge. 
So feel free to put Questions.

No comments:

Post a Comment