The relationship between classes and classes, is-a, etc.

/*
Generalization relationship: the inheritance relationship between classes and interfaces and the inheritance relationship between interfaces and interfaces
Implementation relationship: a class implements an interface
Association relationship: the current class contains references to other classes, and the current object contains References to other objects
Association relationship: the connection between classes, one class can know the properties and methods of another class, which is represented by member variables in the Java language
Aggregation relationship: a kind of
association relationship The class of the association relationship is in At the same level, the aggregation relationship represents the whole and the part. It is represented by instance variables
in the java language. The
composition relationship:
the whole object determines the life cycle of some objects, and some objects only have a composite relationship with one object at a time. It is used
in the java language. Instance variables are reflected
Dependency : reflected in the java language as return values, parameters, local variables and static method calls
*/




is-a Inheritance
is-like-a Class-to-interface implementation
has-a association

Guess you like

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