Full analysis of 23 design patterns (JAVA implementation)

insert image description here

Create mode:

These design patterns provide a way to hide the creation logic while creating an object,
instead of using the new operator to instantiate the object directly.
This makes the program more flexible in deciding which objects need to be created for a given instance.


1. Singleton mode .

2. Factory mode .

3, the abstract factory pattern .

4. Builder mode .

5. Prototype mode .


Structural Patterns:

These design patterns focus on the composition of classes and objects.
The concept of inheritance is used to compose interfaces and to define the way in which composite objects obtain new functionality.


6. Adapter mode .

7. Bridge mode .

8. Combination mode .

9. Decorative mode .

10, Appearance mode .

11. Flyweight mode .

12. Proxy mode .

Behavioral Patterns:

These design patterns are particularly concerned with the transfer of information between objects.


13. Visitor pattern .

14. Template mode .

15. Strategy mode .

16. Status mode .

17. Observer pattern .

18. Memo mode .

19. The mediator model .

20. Iterator pattern .

21. Interpreter mode .

22. Command mode .

23. Chain of Responsibility Model .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325932254&siteId=291194637