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. Actually, in some situations, class Employee could be a I think the point I want to make is that sometimes is-a The Employee/Person example I chose arbitrarily I think the key question to ask is: In your situation, is the bv
Replies:
|
Sponsored Links
|