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.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Introduction. No Comments on What is a design pattern?
3.3
(4)

In this article we will learn about what is a design pattern. In particular we will learn the definition of  a design pattern and its essential elements.

 

According to Christopher Alexander,

“Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.”

 

Definition (In Software Development):

Design patterns are repeatable or reusable solutions to commonly occurring problems in a certain context in software design.

 


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


Four essential elements of a design pattern:

The four essential elements of a design pattern are:

 

Pattern name: The pattern name provides a way to describe the design problem, its solution and consequences in a word or two. A pattern name provides vocabulary using which we can communicate with other people, document them and reference them in software designs. Finding a good name for a design pattern is a major issue.

 

Problem: The problem describes when to apply the pattern and in which context to apply the pattern. The problem may describe the class and object structures in a bad design context. Sometimes, the problem might also list out the conditions that must be pre satisfied to apply the pattern.

 

Solution: The solution describes the elements (classes and objects) that make up the design, their relationships, responsibilities and collaborations. The solution does not describe a particular concrete design or implementation (no code). A pattern is a template that can be applied in many different situations.

 

Consequences: These are the costs and benefits of applying the patterns. These consequences involve space and time trade-offs, language and implementation issues as well as the effect of pattern on system’s flexibility, extensibility or portability. Listing these consequences explicitly enables us to understand and evaluate them.

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *