4 ms·
Perhaps a better way to explain "delegation" would be to say that it means "borrowing a method from some other object then executing it in the context of the bo
by galaxyLogic 9y ago
Perhaps a better way to explain "delegation" would be to say that it means "borrowing a method from some other object then executing it in the context of the borrower.
In O-O the "context" in particular refers to the "message recipient" available as the value of the pseudo-variable 'this' (or 'self' in Smalltalk).
To delegate = To borrow a method.
Delegator = Borrower.
Delegate = Lender.