Open In App

Catalog of Design Patterns

Last Updated : 30 Oct, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A Pattern, in general, refers to the particular layout which helps to perform certain tasks with ease. Technically, patterns can be considered as devices that help the program in sharing the knowledge of their design.

The term design pattern is used in object-oriented terminology to perform the tasks such as defining the objects, classes, interfaces hierarchy and factoring them into classes with relationships. Once all these steps are considered as a pattern they can reuse them by applying them to several common problems.

A design pattern can be considered as a reusable solution for the commonly occurring problems in software design. A Design pattern is not a finished design, rather it is a template to solve the problem in many different solutions. 

The most influential work on design patterns was done by Gamma, Helm, Jonson, and Vlissides are commonly known as Group of Four (GOF). The GoF design pattern can be described as communication among classes and objects which are customized for solving a design problem in a specific context.

Essential Element of Design Pattern:

There are four essential elements of a design pattern. They are  as follows:

  • Pattern Name: It is a unique name that describes a design problem. Pattern name being concise and meaningful, Improves communication, among developers and helps to design patterns at higher levels of abstraction.
  • Problem: It states the problem and its context such as how to represent the algorithm as objects (It ensure when the pattern is applicable and what condition should be met before the pattern is used.
  • Solution: It provides a Description of elements that make the design pattern such as their responsibility, relationship, and collaboration). Pattern solutions cant describe a particular implementation because patterns are like templates that are applicable to several similar situations. The solution gives a generic arrangement of classes and objects to solve a problem.
  • Consequences: As the name implies these highlight the result, pros and cons of applying the patterns, etc,(It Describes the impacts on the system’s portability, extensibility. They determine the costs and evaluate design alternatives of pattern, language, and implementation issues.

The Catalog of Design Patterns:

The Design Patterns are organized into a form of a catalog. These Design Patterns collectively assist in software engineering by finding objects, specifying objects implementations, objects interfaces, determining objects granularity, implementing reuse mechanisms, etc. The Intents specify what the design pattern does. Some of the patterns with their names and intents  are as follows,

  • Abstract Factory: It Indicates what factory is to be instantiated, provides an interface to create families of objects(related / dependent) without any specification of their concrete classes.
  • Adaptor: Id Adapt or converts an interface of a class into another one according to the client expectation and hence, overcomes the problem of incompatible interfaces thereby enabling the classes to work together.
  • Bridge: It Separates abstraction from its implementation to make them independent.
  • Builder: It Separates the complex objects constructions from their representation in order to create different representations with the same construction process.
  • Chain Of Responsibility: It Enables the handling of command objects by passing them to other objects by using the logic present in the processing of objects. In other words, Its decouples sender and receiver by formatting a chain of receiving objects to pass the request until the request is handled by an object.
  • Command: It encapsulates the action and its parameters and hence, enables to parameterize the different requests of the clients such as long or queue requests. It also assists undoable operations.
  • Composite: It represents the objects in a tree structure where each object represents the same interface. This enables clients to treat individual objects and their compositions uniformly.
  • Decorator: It Adds additional functionality to a class at runtime. This Enables flexibility to subclass for adding functionality.
  • Facade: It creates a simplified/unified interface of existing interfaces in the subsystems so as to handle common tasks easily.
  • Factory Method: It Focuses on objects creation of specific implementation. lets the subclass decide as to which class to be instantiated.
  • Flyweight: It Performs sharing of common objects properties by a large number of objects to save space.
  • Interpreter: It Deals with the implementation of a specified computer language that solves specific problems. It interprets sentences in language by representing the grammar of language along with an interpreter.
  • Iterator: It Enables sequential aggregate objects elements by hiding their underlying representations.
  • Mediator:  It provides a unified interface to the set of interfaces in a subsystem. It provides loose coupling which enables objects to refer to each explicitly and also varies objects interaction independently.
  • Momento: It supports the rollback mechanism by enabling the objects, to restore to their previous state without violation of encapsulation.
  • Observer: Whenever an object changes its state, it raises an event that notifies other objects and updates them automatically. This defines a one-to-many dependency between the objects.
  • Prototype:  Here Prototypical instance determines the type of objects to be created. Further new objects are created by cloning this prototype.
  • proxy: It provides an illusion by applying placeholder to other objects in order to have control over it.
  • Singleton: It Provides restrictions on instantiating a class to a single object and also makes it globally accessible.
  • State: It Permits an alteration in the object’s behavior with alteration in its state .i.e allows objects type to change at runtime.
  • Visitors: It Describes the skeleton of a program, enables subclasses to define some steps of the algorithm, and also to redefine certain steps without affecting the structure of the algorithm.
  • Strategy:  It defines the Family of algorithms and their selection based upon the clients.

Uses of Design Patterns in Software Engineering: 

A design pattern in the context of software engineering is a template or reusable solution to common problems occurring in software design. This is usually represented with the classes and objects, interfaces, etc. The one application of a design pattern is “Reusability of Solutions”,  By using the proven solution, users can solve software development issues that enable the development of highly cohesive modules with coupling.

Need of Design pattern:

  • Enables efficient communication between designers.
  • Solves an issue just by referring to pattern name.
  • Improves code readability for coders.
  • Reduce the time to find the solution by reusing tested and proven development paradigms.
  • Reduce the time for coders.
  • Introduces additional levels of indirection to achieve flexibility.
  • Reduce the time for understanding the design.
  • Avoid those alternatives which avoid reusability thereby reducing variations.
  • Improves design understandability and documentation.
  • Helps to understand the basics of object-oriented design more easily and quickly.

 


Previous Article
Next Article

Similar Reads

Connectivity and Composition Patterns | Design Patterns for Cloud Native Applications
In cloud-native applications, the architectural design becomes a critical aspect, defining the success of the entire solution. Connectivity and composition patterns are fundamental design principles that dictate how different components within a cloud-native application communicate and collaborate. Let's delve deeper into the significance of these
9 min read
Difference Between Architectural Style, Architectural Patterns and Design Patterns
Many software professionals think that architectural styles and patterns are the same. Sadly, some of the software developers don’t understand the difference between architectural patterns and design patterns. In this article, we're going to summarize the differences between them. According to MSDN, architectural styles and patterns are the same th
7 min read
Composite Design Pattern | JavaScript Design Patterns
The Composite Design pattern is a way of organizing objects. It helps us handle different objects in a similar way when they are put together to create a structure with parts and wholes. These parts and wholes are like building blocks that can be split into smaller pieces and then put together to make a tree-like structure. The composite design pat
6 min read
Strategy Method Design Pattern | C++ Design Patterns
Strategy Pattern is a behavioral design pattern that defines a family of interchangeable algorithms and allows them to be used interchangeably within a context. This pattern enables the algorithm to be selected at runtime, providing flexibility and promoting code reusability. Important Topics for the Strategy Method in C++ Design Patterns Example o
4 min read
Memento Design Pattern | C++ Design Patterns
Memento Design Pattern is a behavioral design pattern that provides a mechanism for capturing an object's internal state and restoring it to that state at a later time. This pattern is useful when we need to implement features like undo/redo functionality or when we want to save and restore an object's state for various reasons. Important Topics fo
7 min read
What is the Correlation Between System Design and Design Patterns?
System design and design patterns are closely related concepts in software engineering, with design patterns serving as reusable solutions to common design problems encountered during system design. System design and design patterns are interrelated concepts that work together to create robust and well-structured software systems. Important Topics
11 min read
State Method Design Pattern | C++ Design Patterns
In software design, managing the behavior of an object according to its internal state is a common issue. The state pattern addresses this issue by allowing an object to alter its behavior every time its internal state changes. This pattern encapsulates each state in a separate class, which makes it easier to add new states and modify existing stat
7 min read
Template Method Design Pattern | C++ Design Patterns
Template Method Pattern introduces a template in a superclass that defines the steps of an algorithm. These steps may include both common tasks shared among subclasses and specific tasks that need customization. Subclasses then implement or override these steps to modify the algorithm according to their specific needs. Important Topics for Template
7 min read
Data Pipeline Design Patterns - System Design
In system design, data pipeline design patterns play a crucial role in efficiently processing and transporting data across various stages of a system. These patterns help ensure scalability, reliability, and performance when managing data workflows. A well-designed data pipeline can handle large volumes of data, transform it as needed, and move it
8 min read
Design Patterns Cheat Sheet - When to Use Which Design Pattern?
In system design, selecting the right design pattern is related to choosing the right tool for the job. It's essential for crafting scalable, maintainable, and efficient systems. Yet, among a lot of options, the decision can be difficult. This Design Patterns Cheat Sheet serves as a guide, helping you on the path toward optimal design pattern selec
7 min read
Design Patterns: Understand The Importance With Real Life Examples
Software Design Patterns... Software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. This is the definition written on Wikipedia for software design patterns...The above definition makes sense to you if you are an experienced developer and spent some time writing the code for
8 min read
Gang of Four (GOF) Design Patterns
The Gang of Four (GoF) Design Patterns, introduced in the book "Design Patterns: Elements of Reusable Object-Oriented Software," authored by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, provide a catalog of proven solutions to common design problems in software development. The GoF Design Patterns encourage best practices, code reu
8 min read
Design Patterns for Enhancing User Experience
Design Patterns are an integral part of modern software development, playing a pivotal role in enhancing the user experience (UX). These patterns represent well-established solutions to common design and programming challenges, providing a blueprint for creating software that not only functions efficiently but also delivers a superior user interfac
7 min read
Design Patterns Gamma
Elements of Reusable Object-Oriented Software is a software engineering book describing software design patterns. The book was written by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, with a foreword by Grady Booch. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-orie
6 min read
10 Best Design Patterns Books for Beginners to Advanced
In this article, we'll explore ten of the best design pattern books that cater to everyone from beginners to advanced programmers, helping you master the art of writing clean and efficient code. Important Books for Design Patterns1. "Design Patterns": Elements of Reusable Object-Oriented Software2. "Head First Design Patterns": Building Extensible
6 min read
Abstract Factory Pattern | C++ Design Patterns
Abstract Factory Pattern is a creational design pattern used in object-oriented programming. It provides an interface for creating families of related or dependent objects without specifying their concrete classes. This pattern is a way to encapsulate the creation of objects and ensure that they are compatible and properly configured. In this artic
6 min read
Abstract Factory Pattern | JavaScript Design Patterns
Abstract Factory Pattern is to abstract the process of object creation by defining a family of related factory methods, each responsible for creating a different type of object. These factory methods are organized within an abstract factory interface or class, and the client code uses this interface to create objects. Important Topics for the Abstr
6 min read
Command Method | JavaScript Design Patterns
The command method is a behavioral design pattern that encapsulates an incoming request into a standalone object. This object contains all the necessary information to perform a request including the method to call and parameters. Important Topics for the Command Method in JavaScript Design Patterns Why do the we use Command Method?Command Method e
6 min read
Proxy Pattern | C++ Design Patterns
Design Patterns are an essential part of software engineering, offering proven solutions to common problems encountered during software development. One such pattern is the Proxy Pattern. The Proxy Pattern is a structural design pattern that provides a surrogate or placeholder for another object, allowing you to control access to it. This pattern c
7 min read
Design Patterns Architecture
Design patterns and architectural styles play a crucial role in shaping the structure and behavior of software systems. Let's explore several architectural patterns and styles, each with its own characteristics, using examples and suitable diagrams. Important Topics for Design Patterns ArchitectureLayered Architecture (N-Tier Architecture)Microserv
5 min read
Design Patterns in Object-Oriented Programming (OOP)
Software Development is like putting together a puzzle. Object-oriented programming (OOP) is a popular way to build complex software, but it can be tricky when you face the same design problems repeatedly. That's where design patterns come in. Design patterns are like well-known recipes for common problems in software development. They're not step-
15+ min read
Facade Method - C++ Design Patterns
The Facade Pattern is a design pattern in software engineering that falls under the structural pattern category. It provides a simplified and unified interface to a set of interfaces or subsystems within a larger system, making it easier to use and reducing the complexity of the system for clients. Essentially, it acts as a facade or entry point to
10 min read
Factory Method | Java Design Patterns
The factory design pattern is a creational design pattern. It states the best way to create an object without telling the exact class of object that will be created. It is used when we have a super-class with multiple sub-classes and based on input, we want to return one of the sub-class. Important Topics for the Factory Method in Java Design Patte
7 min read
Flyweight Pattern | C++ Design Patterns
A flyweight pattern is a structural design pattern used to optimize memory usage and performance when dealing with a large number of objects that share some common characteristics. It achieves this by separating an object's intrinsic state (shared among multiple objects) from its extrinsic state (unique to each object) and storing the intrinsic sta
9 min read
Introduction to Decorator Pattern in C++ | Design Patterns
The Decorator Pattern is a structural design pattern in software engineering that enables the dynamic addition of new behaviors or responsibilities to individual objects without altering their underlying class structure. It achieves this by creating a set of decorator classes that are used to wrap concrete components, which represent the core funct
12 min read
Introduction to Gang Of Four(GoF) | Design Patterns
The book Design Patterns: Elements of Reusable Object-Oriented Software consists of 23 Design patterns, which are collectively called: "Gang Of Four Design Patterns" (abbreviated as - GoF). The reason why we call it a 'Gang Of Four' is because the book is co-authored by the following 4 authors : Erich GammaRichard HelmRalph JohnsonJohn Vlissi Impor
7 min read
Prototype Pattern | C++ Design Patterns
When designing software, it's crucial to make it efficient, easy to reuse, and simple to maintain. One way to achieve these goals is by using design patterns, and one such pattern is the Prototype Pattern. In this article, we'll explore the Prototype Design Pattern in the context of C++. Important Topics for the Prototype Pattern in C++ Design Patt
5 min read
Singleton Pattern | C++ Design Patterns
A singleton pattern is a design pattern that ensures that only one instance of a class can exist in the entire program. This means that if you try to create another instance of the class, it will return the same instance that was created earlier. The Singleton pattern is useful when we need to have only one instance of a class, for example, a singl
11 min read
Top 30 Java Design Patterns Interview Question
If you want to be a ​software developer or ​engineer, you need to know about design patterns. They're like solutions to common problems in software design. In job interviews, employers ask about design patterns to see if you know what you're doing. So, it's important to be ready for those questions. We've made a list of 30 design pattern interview
15+ min read
Website Design Patterns
Website Design Patterns are essential for web developers, helping them to overcome daily development challenges. These design patterns offer guidelines, to prevent User Interface(UI) errors and also help the developers to create efficient, scalable, maintainable, and reliable web applications. These patterns offer a valuable framework for web devel
5 min read
three90RightbarBannerImg