Names pretty much mean everything.
The IS-A class can be considered as a specialized reference to an instance of another class that inherits all its attributes.
If there is a class named Car . Then any type of vehicle can inherit the attributes of this superclass. For example, a police car inherits all the attributes of a vehicle because it is a specialization of the latter.

The HAS-A class, on the other hand, has a reference to another class or instance of another class. In other words, he shares a connection with another class. There are two types of HAS-A classes, the totality of which means that a class can exist independently and composition, that is, a class can exist only next to the one with which it has a common connection.
It is important to know when to classify an object as a composition class or simply as an attribute of another class.
Taking the Car class, the Driver class will be considered aggregation, because the Driver class can exist as an independent object, even if the Car class ceases to exist.
While the class Engine cannot exist if the class Car does not exist, as the Engine cannot exist outside the scope of the Car .

Bolboa Feb 16 '17 at 3:50 2017-02-16 03:50
source share