As you can see, it’s only slightly more work. But the good thing is, you’re able to reuse the
NetworkCommunicator as if it were a black box. The designer of NetworkCommunicator could have cre-
ated the thing sealed, and you would still be able to reuse it. Had it been sealed, you definitely could
not have inherited from it.
Another downfall of using inheritance is that it is not dynamic. It is static by the very fact that it
is determined at compile time. This can be very limiting, to say the least. You can remove this limita-
tion by using containment. However, in order to do that, you have to also employ your good friend,
polymorphism. By doing so, the contained type can be, say, an interface type. Then, the contained
object merely has to support ...