We have summarized the GoF design patterns (23 types).
| Design pattern | Overview |
|---|---|
| Abstract Factory | Make a product by combining related parts |
| Builder | Assemble complex instances |
| Factory Method | Leave instance creation to subclasses |
| Prototype | Copy and create an instance |
| Singleton | Only one instance |
| Design pattern | Overview |
|---|---|
| Adapter | Cover with one skin and reuse |
| Bridge | Separate feature hierarchy and implementation hierarchy |
| Composite | Identification of container and contents |
| Decorator | Identification of the decorative frame and the contents |
| Facade | Simple window |
| Flyweight | Share the same thing to eliminate waste |
| Proxy | Make it when you need it |
| Design pattern | Overview |
|---|---|
| Chain of Responsibility | Responsibility |
| Command | Make an instruction a class |
| Interpreter | Express grammar rules in classes |
| Iterator | Count one by one |
| Mediator | Only one counselor |
| Memento | Save state |
| Observer | Notify the change of state |
| State | Express the state as a class |
| Strategy | Switch algorithms in a sneak peek |
| Template Method | Leave the specific processing to the subclass |
| Visitor | Work while walking across the structure |
This article and sample program were created based on the following books.
-** Introduction to design patterns learned in Java language **
It was very easy to understand and I learned a lot. Thank you. The detailed explanations of the design patterns and sample programs are written, so please take a look at the books as well.
Recommended Posts