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

Answer Posted / neelkamal yadav

A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. An Employee ISA Person. This relationship is best implemented with inheritance. Employee is derived from Person. A class may have an instance of another class. For example, an employee "has" a salary, therefore the Employee class has the HASA relationship with the Salary class. This relationship is best implemented by embedding an object of the Salary class in the Employee class.

The answer to this question reveals whether the applicant has an understanding of the fundamentals of object- oriented design, which is important to reliable class design.

There are other relationships. The USESA relationship is when one class uses the services of another. The Employee class uses an object (cout) of the ostream class to display the employee's name on the screen, for example. But if the applicant gets ISA and HASA right, you don't need to go any further.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you write a function similar to printf()?

661


Do vectors start at 0?

588


What is an undefined reference/unresolved external symbol error and how do I fix it?

591


What is atoi?

536


What is the use of data hiding?

588






If a function doesn’t return a value, how do you declare the function?

608


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

691


List the types of polymorphism in c++?

618


What is iterator c++?

539


Write about the various sections of the executable image?

567


What is the array and initializing arrays in c++?

501


What is the difference between while and do while loop?

550


What is decltype c++?

552


Explain all the C++ concepts using examples.

682


What is null c++?

579