Dart - Design Pattern

An post for listing design pattern with dart by dopefaceee.

1. Singleton

Singleton is a creational design pattern which ensures that a class has only one instance and also provides a global point of access to it.

2. Adapter

Adapter is a structural design pattern, also known as wrapper. It is one of the most common and most useful design patterns available to us as software developers.

3. Template Method

The Template method is a fundamental technique for code reuse.

4. Composite

The Composite is one of the structural design patterns. Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

5. Strategy

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

6. State

Allow an object to alter its behaviour when its internal state changes. The object will appear to change its class.

7. Facade

Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.

8. Interpreter

Given a language, define a representation for its grammar along with an inter­preter that uses the representation to interpret sentences in the language.

9. Iterator

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

10. Factory

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to sub­classes.

11. Abstract Factory

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

12. Command

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable opera­tions.

13. Memento

Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.

14. Prototype

Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.

Written on January 25, 2020