Generalization in Database

0

I'm modeling a job, I ran into a situation that I do not know how to proceed:

In a medical clinic, a PERSON can be PHYSICAL or LEGAL. THE PATIENT, MAY BE ONLY PHYSICAL PERSON

Here comes the doubt:

The Financial Responsible (RespFin) can be a PHYSICAL or LEGAL person, as long as it is not both simultaneously:

How can I tell the model that RespFin is a generalization of both physics and legal and not simultaneous? What kind of generalization is this?

    
asked by anonymous 27.03.2017 / 05:21

1 answer

0

In your class model, RespFin will derive from Person only. Person will automatically be either Physical or Legal, as you yourself want. The implementation in RespFin will almost certainly have to be override over inheritance.

    
28.03.2017 / 22:14