Design Patterns Tutorial
A tutorial on GOF design patterns. This tutorial is for beginners who are going to learn design patterns for the first time. Each pattern is expalined with suitable examples.

15/11/2013 Categories: Introduction. No Comments on How to select a design pattern

As there are 23 patterns in the catalog it will be difficult to choose a design pattern. It might become hard to find the design pattern that solves our problem, especially if the catalog is new and unfamiliar to you. Below is a list of approaches we can use to choose the appropriate design pattern:

 

Consider how design patterns solve design problems:

Considering how design patterns help you find appropriate objects, determine object granularity, specify object interfaces and several other ways in which design patterns solve the problems will let you choose the appropriate design pattern.

 

Scan intent sections:

Looking at the intent section of each design pattern’s specification lets us choose the appropriate design pattern.

 

Study how patterns interrelate:

The relationships between the patterns will direct us to choose the right patterns or group of patterns.

Below figure will guide you in remembering the related patterns:

 

design patterns relationships

 

Study patterns of like purpose:

Each design pattern specification will conclude with a comparison of that pattern with other related patterns. This will give you an insight into the similarities and differences between patterns of like purpose.

 

Examine a cause of redesign:

Look at your problem and identify if there are any causes of redesign. Then look at the catalog of patterns that will help you avoid the causes of redesign.

 

Consider what should be variable in your design:

Consider what you want to be able to change without redesign. The focus here is on encapsulating the concept that varies.

Suryateja Pericherla

Suryateja Pericherla

Hello, I am Suryateja Pericherla working as an Asst. Professor in CSE department at Vishnu Institute of Technology. I write articles to share my knowledge and make people knowledgeable regarding certain topics.
Suryateja Pericherla

Latest posts by Suryateja Pericherla (see all)

Related Links:

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.
Scroll Up