Dart Design Patterns
Патерны(шаблоны) на языке Dart
Design Pattern Categorization
Design patterns can be categorized in multiple ways, but the most popular one is the following:
Creational design patterns
Structural design patterns
Behavioral design patterns
Concurrency design patterns
Architectural design patterns
Creational Design Patterns
These patterns deal with object creation mechanisms which optimize object creation compared to a basic approach. The basic form of object creation could result in design problems or in added complexity to the design. Creational design patterns solve this problem by somehow controlling object creation. Some of the popular design patterns in this category are:
Factory method
Abstract factory
Builder
Prototype
Singleton
Structural Design Patterns
These patterns deal with object relationships. They ensure that if one part of a system changes, the entire system doesn’t need to change along with it. The most popular patterns in this category are:
Adapter
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
Behavioral Design Patterns
These types of patterns recognize, implement, and improve communication between disparate objects in a system. They help ensure that disparate parts of a system have synchronized information. Popular examples of these patterns are:
Chain of responsibility
Command
Iterator
Mediator
Memento
Observer
State
Strategy
Visitor
Concurrency Design Patterns
These types of design patterns deal with multi-threaded programming paradigms. Some of the popular ones are:
Active object
Nuclear reaction
Scheduler
Architectural Design Patterns
Design patterns which are used for architectural purposes. Some of the most famous ones are:
MVC (Model-View-Controller)
MVP (Model-View-Presenter)
MVVM (Model-View-ViewModel)
In the following section, we are going to take a closer look at some of the aforementioned design patterns with examples provided for better understanding.