Inheritance question

Say that you got a base Class Employee, and several Derived Classes - Developer, Administrator, Secretary.

On what occasion would you need to instantiate the Base Class Employee, and not one of the Derived Class?

As it seems to me that one would always need to instantiate the Derived Class for his usage.

Thanks.
On what occasion would you need to instantiate the Base Class Employee, and not one of the Derived Class?
When you need it. Without knowing your architecture requirements, design goals it is impossible to tell for sure: you designed class hierarchy, so you should know when to use those classes.

For example what if you need to enter temporary employee which is not a developer, administrator or secretary? What would you do?
That's a great example!
Thank you!
Topic archived. No new replies allowed.