Object-oriented: understanding of inheritance, association, aggregation, combination, and dependency, and object-oriented Aggregation
For example, please correct
1. Inheritance (generalization)
Link: a inherits from B, a is B
As shown in the figure, Benz, Audi, and Lamborghini all inherit from cars and all have wheels. They can both forward and stop.
Benz is a car.
Audi is a car.
Lamborghini is a car.
2. Association
Link: a has B
3. Aggregation
Link: a has B
The whole part is not responsible for the destruction of local objects, and the lifecycle of the two is not associated.
4. Combination
Link: a has B
The whole part is responsible for the destruction of local objects.
5. Dependency
Link: a use B
Inheritance represents the vertical relationship between classes.
The other four types reflect the horizontal relationship between classes.
Coupling Strength:
Dependency <join <aggregation <combination
In terms of semantics
Inheritance (A is B)
Association, aggregation, and combination (A has B)
Dependency (A use B)
When combination and dependency are combined, inheritance can be replaced.
Combination + dependency (Object-based) vs inheritance (object-oriented)