[Newbies] delegation vs inheritance
gruntfuttuck at gmail.com
Sat Aug 4 17:13:31 UTC 2007
Thanks for the reply. I find it very interesting what you say but am
struggling to understand it and the info in the link. I have googled
"forwarding vs delegation" but am still confused. I think what I need to do
is explore this in the morning when my brain is fresh.
I know this isn't squeak specific but I would rather ask here than a PHP
from: Michael Haupt-3
On 8/4/07, Ron Teitelbaum <Ron at usmedrec.com> wrote:
> I have to ask is Grunt your real name? Do you have a real name?
>indeed. I'd be interested to know as well.
>Apart from what Ron has answered, I'd like to point out that Stack
does not delegate to LinkedList; what is being done there is
forwarding. The difference is subtle but important in certain
>In case Stack would delegate to LinkedList, "self" would be the Stack
instance in all LinkedList methods invoked during Stack operations.
Delegation, however, is not supported directly in Smalltalk. Instead,
Stack forwards requests to LinkedList, implying that "self" is bound
to a LinkedList instance instead of a Stack instance in all LinkedList
methods invoked during Stack operations.
>More on this can be found on
View this message in context: http://www.nabble.com/delegation-vs-inheritance-tf4216781.html#a11998349
Sent from the Squeak - Beginners mailing list archive at Nabble.com.
More information about the Beginners