This repository contains sample implementations of GoF design patterns in Dart.
Inspired by https://github.com/dbacinski/Design-Patterns-In-Kotlin.
Still have to find a way to print some object it pointed by a reference.
There is a nice way of creating objects with a named constructor just like with static factory methods in Java.
There is no support for inner classes.
This one can be done using factory constructor.
This singleton implementation utilizes lazy loading of global variables. There is also a way of implementing a singleton with a factory constructor that always returns the same instance.
Provides a link between two incompatible types by wrapping one type with a class that supports the interface required by the client.
Used to express a request including the call to be made and the required parameters in a command object. It may then be executed immediately or held for later use.
Used to define the grammar for instructions that form part of a language or notation, whilst allowing the grammar to be easily extended.
The memento pattern is used to capture the current state of an object and store it in such a manner that it can be restored at a later time without breaking the rules of encapsulation.
The observer pattern is used to allow an object to publish changes to its state. Other objects subscribe to be immediately notified of any changes.
The template method pattern is used to define the basic steps of an algorithm and allow the implementation of the individual steps to be changed.