You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It depends on the case. The issue with inheritance is that it breaks encapsulation and creates a tight coupling between the parent class and subclasses.<br/>
6
-
We might end up also with a single big class. On the other hand, with the composition, we might end up with a lot of small classes. If the relation between the object is `is a` and we.</br>
7
-
want to have slightly different behavior, I would choose inheritance. In other cases, I would choose a composition.
6
+
We might end up also with a single big class. On the other hand, with the composition, we might end up with a lot of small classes. If the relation between the object is `is a` and we want to have slightly different behavior, I would choose inheritance. In other cases, I would choose a composition.
0 commit comments