{"id":40230,"date":"2023-09-24T04:30:33","date_gmt":"2023-09-24T04:30:33","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=40230"},"modified":"2023-09-24T04:30:35","modified_gmt":"2023-09-24T04:30:35","slug":"list-of-popular-design-pattern","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/list-of-popular-design-pattern\/","title":{"rendered":"List of Popular Design Pattern"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"971\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/09\/1693267942044.jpeg\" alt=\"\" class=\"wp-image-40231\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/09\/1693267942044.jpeg 800w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/09\/1693267942044-247x300.jpeg 247w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/09\/1693267942044-768x932.jpeg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>A design pattern is a general reusable solution to a commonly occurring problem in software design. It is not a finished design that can be transformed directly into source or machine code. Rather, it is a description or template for how to solve a problem that can be used in many different situations.<\/p>\n\n\n\n<p>Design patterns are often used to solve problems related to object-oriented design, but they can also be used to solve problems in other areas of software development, such as functional programming and distributed systems.<\/p>\n\n\n\n<p>There are many different design patterns, but some of the most common ones include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Singleton:<\/strong>&nbsp;This pattern ensures that there is only one instance of a class in existence.<\/li>\n\n\n\n<li><strong>Factory:<\/strong>&nbsp;This pattern creates objects without exposing the underlying creation logic to the client code.<\/li>\n\n\n\n<li><strong>Builder:<\/strong>&nbsp;This pattern separates the construction of a complex object from its representation.<\/li>\n\n\n\n<li><strong>Observer:<\/strong>&nbsp;This pattern allows objects to be notified of changes to other objects.<\/li>\n\n\n\n<li><strong>Adapter:<\/strong>&nbsp;This pattern allows objects with incompatible interfaces to work together.<\/li>\n\n\n\n<li><strong>Decorator:<\/strong>&nbsp;This pattern allows objects to be dynamically extended with new functionality.<\/li>\n<\/ul>\n\n\n\n<p>Design patterns are reusable solutions to common problems encountered in software design and development. They provide proven, structured approaches to solving specific design challenges. Here&#8217;s a list of some commonly used design patterns categorized into three main groups: creational, structural, and behavioral.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creational Design Patterns:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Singleton Pattern:<\/strong> Ensures a class has only one instance and provides a global point of access to it.<\/li>\n\n\n\n<li><strong>Factory Method Pattern:<\/strong> Defines an interface for creating an object but lets subclasses alter the type of objects that will be created.<\/li>\n\n\n\n<li><strong>Abstract Factory Pattern:<\/strong> Provides an interface for creating families of related or dependent objects without specifying their concrete classes.<\/li>\n\n\n\n<li><strong>Builder Pattern:<\/strong> Separates the construction of a complex object from its representation, allowing the same construction process to create different representations.<\/li>\n\n\n\n<li><strong>Prototype Pattern:<\/strong> Creates new objects by copying an existing object, known as the prototype.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Structural Design Patterns:<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li><strong>Adapter Pattern:<\/strong> Allows the interface of an existing class to be used as another interface.<\/li>\n\n\n\n<li><strong>Bridge Pattern:<\/strong> Separates an object&#8217;s abstraction from its implementation, allowing them to vary independently.<\/li>\n\n\n\n<li><strong>Composite Pattern:<\/strong> Composes objects into tree structures to represent part-whole hierarchies.<\/li>\n\n\n\n<li><strong>Decorator Pattern:<\/strong> Attaches additional responsibilities to an object dynamically, providing a flexible alternative to subclassing.<\/li>\n\n\n\n<li><strong>Facade Pattern:<\/strong> Provides a simplified interface to a set of interfaces in a subsystem, making it easier to use.<\/li>\n\n\n\n<li><strong>Flyweight Pattern:<\/strong> Reduces memory usage or computational expenses by sharing as much as possible with other related objects.<\/li>\n\n\n\n<li><strong>Proxy Pattern:<\/strong> Provides a surrogate or placeholder for another object to control access to it.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Behavioral Design Patterns:<\/h3>\n\n\n\n<ol class=\"wp-block-list\" start=\"13\">\n<li><strong>Chain of Responsibility Pattern:<\/strong> Passes a request along a chain of handlers. Each handler decides whether to process the request or pass it to the next handler in the chain.<\/li>\n\n\n\n<li><strong>Command Pattern:<\/strong> Encapsulates a request as an object, allowing for parameterization of clients with queuing, requests, and operations.<\/li>\n\n\n\n<li><strong>Interpreter Pattern:<\/strong> Defines a grammar for interpreting a language and provides an interpreter to interpret sentences in the language.<\/li>\n\n\n\n<li><strong>Iterator Pattern:<\/strong> Provides a way to access elements of an aggregate object sequentially without exposing its underlying representation.<\/li>\n\n\n\n<li><strong>Mediator Pattern:<\/strong> Defines an object that centralizes communication between objects in a system, promoting loose coupling.<\/li>\n\n\n\n<li><strong>Memento Pattern:<\/strong> Captures an object&#8217;s internal state so that it can be restored to this state later.<\/li>\n\n\n\n<li><strong>Observer Pattern:<\/strong> Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.<\/li>\n\n\n\n<li><strong>State Pattern:<\/strong> Allows an object to alter its behavior when its internal state changes. The object will appear to change its class.<\/li>\n\n\n\n<li><strong>Strategy Pattern:<\/strong> Defines a family of algorithms, encapsulates each one, and makes them interchangeable. It allows the algorithm to vary independently from the context that uses it.<\/li>\n\n\n\n<li><strong>Template Method Pattern:<\/strong> Defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps of the algorithm without changing its structure.<\/li>\n\n\n\n<li><strong>Visitor Pattern:<\/strong> Represents an operation to be performed on elements of an object structure. It lets you define a new operation without changing the classes of the elements on which it operates.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A design pattern is a general reusable solution to a commonly occurring problem in software design. It is not a finished design that can be transformed directly into source or&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-40230","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/40230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=40230"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/40230\/revisions"}],"predecessor-version":[{"id":40232,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/40230\/revisions\/40232"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=40230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=40230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=40230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}