Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

GOF design patterns

Sumit Rawal answered on August 31, 2023 Popularity 9/10 Helpfulness 4/10

Contents


More Related Answers

  • What Is Gang of Four (GOF) in Design Patterns?
  • bff design pattern

  • GOF design patterns

    1

    The Gang of Four (GoF) design patterns are a set of 23 software design patterns that were introduced in the book "Design Patterns: Elements of Reusable Object-Oriented Software," written by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. This book, often referred to as the GoF book, was published in 1994 and has become a seminal work in the field of software design.

    The 23 GoF design patterns are categorized into three main groups based on their purpose:

    Creational Patterns:

    Singleton: Ensures a class has only one instance and provides a global point of access to it.

    Factory Method: Defines an interface for creating objects, but lets subclasses decide which class to instantiate.

    Abstract Factory: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.

    Builder: Separates the construction of a complex object from its representation, allowing the same construction process to create different representations.

    Prototype: Creates new objects by copying an existing instance, thus avoiding the overhead of creating objects from scratch.

    Structural Patterns:

    6. Adapter: Converts the interface of a class into another interface that clients expect.

    Bridge: Decouples an abstraction from its implementation, allowing both to vary independently.

    Composite: Composes objects into tree structures to represent part-whole hierarchies. Clients can treat individual objects and compositions uniformly.

    Decorator: Adds behavior to objects dynamically, without affecting the behavior of other objects from the same class.

    Facade: Provides a unified interface to a set of interfaces in a subsystem, making the subsystem easier to use.

    Flyweight: Shares objects to support large numbers of fine-grained objects efficiently.

    Behavioral Patterns:

    12. Chain of Responsibility: Passes a request along a chain of handlers, allowing multiple objects to handle the request.

    Command: Encapsulates a request as an object, thereby allowing parameterization of clients with different requests, queuing of requests, and logging of their execution.

    Interpreter: Provides a way to evaluate language grammar or expressions.

    Iterator: Provides a way to access elements of a collection without exposing its underlying representation.

    Mediator: Reduces direct connections between multiple classes by introducing a mediator object that controls the communication.

    Memento: Allows an object's state to be captured and restored, providing undoable operations.

    Observer: Defines a dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

    State: Allows an object to change its behavior when its internal state changes.

    Strategy: Defines a family of algorithms, encapsulates each one, and makes them interchangeable.

    Template Method: Defines the structure of an algorithm in a base class but lets subclasses override specific steps.

    Visitor: Lets you add further operations to objects without having to modify them.

    These design patterns provide solutions to common design problems in software development and promote principles such as encapsulation, loose coupling, and separation of concerns. Developers use these patterns to improve the reusability, maintainability, and flexibility of their code.

    Popularity 9/10 Helpfulness 4/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Aug 31 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.