-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
  • 31,458
  • 53
  • 132
  • 196

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
  • 158,668
  • 41
  • 218
  • 248