doing a little project. im demonstrating inheritance.
i have an employee class.
classes which inherit this are BusinessEmp, MaintenanceEmp, ITEmp.......
i have a form to create employees. a dropdown box lets me select the employee type.
rather than hardcoding it
if(combo.selectedItem = "businessEmp")
{
//create new businessEmp
}
if(combo.selectedItem = "ITEmp"()
{
//create new ITEmp
}
...
...
i want it to be extensible, so that if someone added a different type of employee, all they would have to do is add in the new employee class. is this possible ( cant use a database)?i can hard code them if i want, but id rather learn to do it this way, seems like there would be more merrit to it
i have an employee class.
classes which inherit this are BusinessEmp, MaintenanceEmp, ITEmp.......
i have a form to create employees. a dropdown box lets me select the employee type.
rather than hardcoding it
if(combo.selectedItem = "businessEmp")
{
//create new businessEmp
}
if(combo.selectedItem = "ITEmp"()
{
//create new ITEmp
}
...
...
i want it to be extensible, so that if someone added a different type of employee, all they would have to do is add in the new employee class. is this possible ( cant use a database)?i can hard code them if i want, but id rather learn to do it this way, seems like there would be more merrit to it