dynamic delegation of Behaviors

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
ooper
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 46
Joined: Mon Aug 17, 2009 12:22 am

dynamic delegation of Behaviors

Post by ooper » 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

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: dynamic delegation of Behaviors

Post by mwieder » Sun Nov 29, 2009 1:27 am

? Delegating works for me with 4.0... haven't tried this with 3.5.

Post Reply