Specialization hierarchy in a domain-model
- by devoured elysium
I'm trying to make the domain model of a management system. I have the following kinds of persons in this system:
employee
manager
top mananger
I decided to define a User, from where employee, manager and top manager will specialize from.
What I don't know is what kind of specialization hierarchy I should choose from. I thought of two ways:
or
Which might be preferable and why?
As a long time coder, every time I try to do a domain-model, I have to fight against the idea of trying to think in how I'm going to code this. From what I've understood, I should not think about those matters in the domain-model, only in object relationships. I don't have to think of code duplication or any of these kind of details here, so I can't really pick any of the options over the other.
Thanks