I have a system that handles many types of worker roles (around 30) in the company where I work. They all have data in common (such as personal data). What I would like to make more efficient is to reuse method code for many types of workers. Some of the classes are: Manager
, Director
and Employee
each one must check its input time and I do that with another class called Company
, so I have three methods for the class:
public class Company
{
public void CheckIn(Director Person)
{
}
public void CheckIn(Employee Person)
{
}
public void CheckIn(Manager Person)
{
}
}
Depending on the role that enters the company, different things happen at the entrances to the entire building. I hope I made myself understood.