PDA

View Full Version : Using or inheriting a class



audinue
11-20-2008, 11:05 AM
In object oriented programming...

When we should using (as a member) or inheriting a related class to our class?
Anything can be considered to make our decision?

(Any object oriented programing language are not prohibited)

Thanks in advance.

laserlight
11-20-2008, 11:12 AM
Consider the Liskov Substitution Principle (http://www.objectmentor.com/resources/articles/lsp.pdf) (warning: PDF file).

Magos
11-20-2008, 12:11 PM
Lookie here (http://www.google.se/search?hl=sv&q=composition+vs+inheritance&meta=)