Design Pattern

Design Pattern

« Back to Glossary Index
Email
Twitter
Visit Us
Follow Me
LINKEDIN
Share
Instagram

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. Design patterns are not a finished design that can be transformed directly into code. They are descriptions or templates for how to solve a problem that can be used in many different situations.

Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects who are familiar with the patterns.

Design patterns are classified into three categories, each with its own sub-patterns:

  1. Creational Patterns: These deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. Examples of Creational patterns are Singleton, Factory, Abstract Factory, Builder, and Prototype.
  2. Structural Patterns: These concern class and object composition. They use inheritance to compose interfaces and define ways to compose objects to obtain new functionality. Examples of Structural patterns are Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy.
  3. Behavioral Patterns: These are specifically concerned with communication between objects, how objects operate, and their responsibilities. Examples of Behavioral patterns are Observer, Mediator, Visitor, Command, Memento, State, Strategy, Template Method, and Iterator.

It’s important to note that the term “pattern” in this context is usually attributed to the book “Design Patterns: Elements of Reusable Object-Oriented Software” by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (also known as the Gang of Four, or GoF), which popularized the concept.

You may also like...