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 wonder if we're not getting a little far afield with some of our OO conceptualizations when we are debating the Employee/Person issue. While in practice, I do not take issue with the idea of composition making some types of change easier to handle, composition specifically denotes, according to the gurus, a 'part-of' relationship. In Bill's original article, Example2, has Apple composed of Fruit. Is Fruit part-of Apple? Or are we really using Apple as a wrapper for Fruit? Facade is a recognized pattern, but seems a little out of bounds if we are talking Composition vs. Inheritance. It is interesting that Java conventions have us coding all classes as descendants of java.lang.Object, although to me this appears to be for primarily mechanical reasons, rather than meaningful 'is-a' relationship. Since Java allows only single inheritance (still a blessing IMHO), we're a little constrained from the start.
Replies: |
Sponsored Links
|