Design Pattern

The following is a compilation of articles based on the “Design Patterns: Elements of Reusable Object-Oriented Software,” authored by the Gang of Four.

#Creational Pattern#Structural Pattern#Behavioral Pattern

  • Bridge

    作者:

    分類:

    Bridge pattern is a structural design pattern. Involves further subdividing the features or behaviors of a object, aiming to separate object.

  • Adapter

    作者:

    分類:

    The Adapter pattern (a.k.a Wrapper, similar to Decorator pattern) is a structural design pattern commonly used to wrap a pre-existing class.

  • Builder

    作者:

    分類:

    Builder is a creational pattern, a.k.a construction pattern. It involves separating the construction process of a object and reassembling it.

  • Abstract factory

    作者:

    分類:

    The Abstract Factory is a creational design pattern that extends the concept of the Factory Method pattern.

  • Prototype

    作者:

    分類:

    The Prototype pattern is a creational design pattern that aims to reduce the cost of creating objects by copying them.

  • Singleton

    作者:

    分類:

    The Singleton pattern is a creational design pattern that ensures a class has only one instance in the program.

  • Factory method

    作者:

    分類:

    Factory Method is a creational design pattern. Its purpose is to defer the instantiation, means the object creation is written in the factory.