I am working on designing an Employee/Manager structure.
- I have a Person Interface.
- The Employee class implements the Person Interface.
- The Manager is also an Employee and have the same restrictions like Employee.
- An Employee can be promoted to a Manager.
I looked in to this Design data structure for Employee-Manager but I don't like the answer provided the post. The Manager extends from Employee which means that Manager also has a promote() method which seems to break liskov-substitution.
Can someone please guide me on the correct path. Thanks.
Aucun commentaire:
Enregistrer un commentaire