Skip to content

Commit 53f9572

Browse files
authored
Update inheritance-vs-composition.md
1 parent cbe0f4a commit 53f9572

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

design-patterns/inheritance-vs-composition.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
## [Krzysztof Grzybek](https://github.com/krzysztof-grzybek)
44

55
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

Comments
 (0)