aspose file tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Composition Vs Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "Composition Vs Inheritance" Watch "Composition Vs Inheritance" New topic
Author

Composition Vs Inheritance

anagha patankar
Ranch Hand

Joined: Dec 26, 2005
Posts: 53
Hello everybody ,
At the onset with due respect to all - I would like to state that I am not interested into getting into the details pertaining to UML notation .

Have tried googling around - and the only reason that I could understand
was that in case of inheritance it is difficult to change the
superclass method signature ( would cause a break in implementation classes )

so question is - is this the only reason that one should choose composition ?
Agreed that one must make a judgemental call - could someone point me to some
articles that compare when to use composition , when not to and similarly regarding inheritance .

Finally - is this the right forum for such questions ?

Thanks,
-anagha
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Why extends is evil
Uses and Abuses of Inheritance, Part 1
Template Method and Strategy: Inheritance vs. Delegation


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Composition Vs Inheritance
 
Similar Threads
Thread vs Runnable
Regarding inheritance and composition
Inheritance or composition?
composition vs inheritance
relation between Caretaker and Orignator in Memento pattern UML representation