dynamic delegation of Behaviors
Posted: Sat Nov 28, 2009 11:07 am
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
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