Categories

Jun 15 in C++

Q:

Explain the ISA and HASA class relationships. How would you implement each?

1 Answer

Jun 16

“ISA” relationship usually exhibits inheritance as it implies that a class “ISA” specialized version of another class. For Example, An employee ISA person. That means an Employee class is inherited from the Person class.

Contrary to “ISA”, “HASA” relationship depicts that an entity may have another entity as its member or a class has another object embedded inside it.

So taking the same example of an Employee class, the way in which we associate the Salary class with the employee is not by inheriting it but by including or containing the Salary object inside the Employee class. “HASA” relationship is best exhibited by containment or aggregation.

Click here to read more about C++
Click here to read more about Insurance

Related questions

Madanswer
Jun 19, 2019 in C++
Aug 17 in HTML
Jul 16, 2019 in C++
...