Abstract factory pattern of GoF design pattern and its examples
definition:
Product hierarchy structure: product hierarchy structure is the inheritance structure of products. For example, an abstract class is TV, and its subclasses include Haier TV, Hisense TV and TCL TV. Then the abstract TV forms a product hierarchy between TVs without specific brands. The image TV is the parent class, while the TV of sp ...
Posted by grim1208 on Sun, 06 Mar 2022 06:06:15 +0100
Draw class diagram using PlantUml plug-in
1, Introduction to PlantUml2, Summarize and sort out the relationship between classes3, Introduction to PlantUml class diagram syntax4, Class diagram5, Class diagram PlantUml code
This article describes how to use the PlantUml plug-in to draw Uml diagrams
1, Introduction to PlantUml
PlantUML is a tool that can quickly write various diagram ...
Posted by zaneosak on Sat, 26 Feb 2022 01:33:52 +0100
C++/SFML, object-oriented curriculum design, tank war
1, Design task and requirement analysis
"Tank battle" is a plane shooting game developed by Namco game company in Japan. It was sold in 1985. The theme of the game is tank battle and defending the base, which belongs to the strategic online class. With the theme of World War II tanks, it not only retains the operability of shooting g ...
Posted by Canman2005 on Fri, 25 Feb 2022 15:45:54 +0100
Design mode_ 07 builder mode
7. Builder mode
7.1 general
Separate the construction and representation of a complex object, so that the same construction process can create different objects.
7.2 structure
Abstract Builder: this interface specifies the creation of those parts of complex objects, and does not involve the creation of specific object parts. Concrete B ...
Posted by df75douglas on Fri, 18 Feb 2022 20:16:54 +0100
Composition Reuse Principle and UML class diagram
Synthetic Reuse Principle
Composite Reuse Principle (CRP) is also called Composition/Aggregate Reuse Principle (CARP)
The principle is to try to use composition / aggregation instead of inheritanceFind out what changes may be needed in the application, separate them, and don't mix them with the code that doesn't need to change.Programming for ...
Posted by roach on Fri, 28 Jan 2022 13:59:59 +0100
[design mode] Flyweight Pattern
🔥 core
Meta sharing mode reduces the memory occupied by objects by sharing the same state shared by multiple objects.
The essence of meta mode is caching.
🙁 Problem scenario
You are a game map modeler, building complex game maps.
Now, you need to build a forest. There are thousands of trees in the forest. No tree has attributes ...
Posted by Admin32 on Tue, 21 Dec 2021 22:20:04 +0100
[design mode] memo pattern
🔥 core
Memo mode captures the internal state of an object and saves the state outside the object,
This allows you to restore the object to its original saved state later.
🙁 Problem scenario
You are a poster designer twenty years ago. Recently, a powerful graphics editing software (PS) was born, and you became the first batch of ...
Posted by crazy/man on Tue, 21 Dec 2021 20:32:47 +0100