-3

Should composition be favoured over inheritance as rule - in all circumstances?

I have read that inheritance is actually now being seen as an anti pattern. My problem with that is that some relationships logically fit into inheritance i.e. is-a relationships.

But from reading lately this is seen as wrong?

What is the way to go with this?

Marty Wallace
  • 34,046
  • 53
  • 137
  • 200

1 Answers1

0

No, composition should not be favoured over inheritance as rule in all circumstances. You generally use them for different things and in different situations.

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251