Page 1 of 1

dynamic delegation of Behaviors

Posted: Sat Nov 28, 2009 11:07 am
by ooper
First, I was pleased to see that a behavior is its own instance after you set an object's behavior. For example, a local variable can be different between RunRev objects after they have been set and executed. Coming from an OO world, this is what I expected. Cool!

However, there seems to be no way to dynamically set a memory-resident behavior to a third object --even though the language allows me to "set the behavior of btn 3 to the behavior of btn 1." What you get is really just the code before it gets executed. My expectation would be that any memory-resident data would be available to the third button after it's behavior is set. This is what is known as "delegation", in the object-oriented world and typically favored over inheritance.

While I understand you called it behavior to imply code only, but I think being able to dynamically set behaviors that include data would be an excellent object oriented addition to the platform.

Perhaps you guys can revisit this behavior --no pun intended.

Rgds,
/Carl

Re: dynamic delegation of Behaviors

Posted: Sun Nov 29, 2009 1:27 am
by mwieder
? Delegating works for me with 4.0... haven't tried this with 3.5.