When we should use Inheritance and when Composition?

As I had previously posted a topic on Inheritance Vs Composition, I was little confused to say where to use what. Later after some study and surfing I found that we should use inheritance when we are force to, good idea to use the inheritance is only when the “Parent “ must call back to “Child” methods. Otherwise in general Composition will be always the better option to use.

Later I read two Article on the same Topic, which clear my idea very much, so I will like to refer these address to my users to follow these given link to be more clear:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: