0

So I have a class called "PERSON" then three data structures "Employees" , "Manager" and "Customer" but manager should have everything that employee has but with more capabilities but not more member variables right?

I am creating a hypothetical call center. I am trying to figure out if I should create a data structure person. Then another for staff then employee and manager derive from there. and then another derived data structure called customer.

Jessica Warren
  • 378
  • 1
  • 4
  • 15
  • 1
    Possible duplicate of [Prefer composition over inheritance?](https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance), This should clarify your question. – qwerty_so Oct 06 '17 at 15:00
  • 1
    "Employees" , "Manager" are attributes as person can be both at the same time and related by "reports-to". these can be roles so that same employee object behaves as Manager or Reportee by type casting. "Customer" may have different state structure. but important point is that every Employee can be Customer but opposite is not true. – Kedar Tokekar Oct 07 '17 at 01:41

0 Answers0