I have an abstract base class called Person with subclasses Employee and Customer.
How do you deal with the situation where Employee is also a Customer? How would this series of entities be created?
Cheers
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want Employee to be a Customer, then Customer probably should not derive from person, but be it’s own hierarchy of classes, which (typically) encapsulates a Person.
In many ways this makes more sense, since a Customer may also be a company or other form of entity, and not a Person.