The Artima Developer Community
Sponsored Link

Re: One sided comparison



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.


Re: One sided comparison

Posted by Mike Mannion on 09 Nov 1998, 1:38 AM

For me this inheritance vs composition issue all comes down to designing solutions which

(a) most effectively model the problem at hand
(b) which permit evolution
(c) which are practical roughly that order of importance.

I therefore find it quite irritating that a language mechanism - an implementation detail if you will - should oblige me to bias my design towards composition, no matter what the situation.
From the point of view of keeping both compilation and runtime semantics as simple as possible, the single class/multiple interface inheritance solution is undoubtadly a clever trick. But it has nothing to do with OO and developers would be wise to recognise this fact when crafting designs - to avoid inadvertently emphasising (c) as opposed (a).
May I suggest, therefore, that emphasis/bias which Bill has given to composition in this article is at least in part a consequence of the restrictions imposed by the Java language itself.
What do you think Bill? Has your mind been corrupted ;-) ???


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us