In this article we will learn about the approaches that can be used for 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:
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, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
Leave a Reply