Design patterns are typical solutions to commonly occurring problems in software design. They are like pre-made blueprints that you can customize to solve a recurring design problem in your code.
You can’t just find a pattern and copy it into your program, the way you can with off-the-shelf functions or libraries. The pattern is not a specific piece of code, but a general concept for solving a particular problem. You can follow the pattern details and implement a solution that suits the realities of your own program.
These patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code.
- Factory Method
- Builder
- Singleton
- Abstract Factory
- Prototype
These patterns explain how to assemble objects and classes into larger structures while keeping these structures flexible and efficient.
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
These patterns are concerned with algorithms and the assignment of responsibilities between objects.
- Chain of resposibility
- Command
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template Method
- Visitor
Each commit will represent another design pattern.
Idea is to commit once a day everyday through 22 days.
Each commit will include:
- Code example in
src/
doc.md
- about current design patternimg/
- image files for doc.md- this very file (
design_patterns.md
)
Each commit concerns one design pattern so:
<name.toUpper()> (<group>)
For example:
BUILDER (Creational Pattern)
Sequence is based on popularity and my desire to learn concrete design pattern:
- FACTORY METHOD (Creational Pattern)
- DECORATOR (Structural Pattern)
- OBSERVER (Behavioral Pattern)
- SINGLETON (Creational Pattern)
- STATE (Behavioral Pattern)
- ADAPTER (Structural Pattern)
- STRATEGY (Behavioral Pattern)
- BUILDER (Creational Pattern)
- COMMAND (Behavioral Pattern)
- CHAIN OF RESPONSIBILITY (Behavioral Pattern)
- PROTOTYPE (Creational Pattern)
- TEMPLATE METHOD (Behavioral Pattern)
- PROXY (Structural Pattern)
- ITERATOR (Behavioral Pattern)
- BRIDGE (Structural Pattern)
- ABSTRACT FACTORY (Creational Pattern)
- MEDIATOR (Behavioral Pattern)
- FACADE (Structural Pattern)
- MEMENTO (Behavioral Pattern)
- COMPOSITE (Structural Pattern)
- VISITOR (Behavioral Pattern)
- FLYWEIGHT (Structural Pattern)