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
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
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.