Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I was intrigued by your statement that you may not necessarily model Employee as a subclass of Person, which is something I have always thought to be the case. How would you then pass an Employee to a method that expects a Person? I suspect that Employee would have a contructor that takes a Person as an argument and would also have a method getPerson() which returns a reference to that person object. This solution seems a but ugly to me since you would really like to pass that Employee around the system as if it were a Person.
Replies:
|
Sponsored Links
|