Introduction to Delegation
We'll cover the following...
Both inheritance and delegation, which are distinctive design tools in OO programming, promote reuse by way of extending one class from another. We have to wisely choose between them. Languages’ capabilities often limit our choices, and this is where Kotlin’s ability to support both comes into play.
While powerful and often used, inheritance—where a class derives properties, methods, and ...