monte at sweattechnologies.com
Thu Mar 31 00:10:13 EDT 2011
On 31/03/2011, at 2:49 PM, Todd Geist wrote:
> Thanks everyone for answering my earlier questions on adapting MVC to rev.
> I have moved on to one more. Although this one isn't really MVC.
> A couple of the frameworks I have used have a concept called "data binding".
> This usually means something along the lines of when one property changes
> another property is automatically updated. The two properties are said to
> be "Bound". I like this concept and it seems like something that could be
> useful to Live Code.
> It seems that you could broadcast the change of a property of an object. And
> other objects could listen for that change, and update themselves
> Again, in effort to avoid re-inventing the wheel, I am curious if there any
> one has tried this sort of thing and if it proved useful.
I'm sorry I haven't been following the conversation but this is something I occasionally wish we had. It would be nice to have a listenProp control structure but this is only necessary if you want two objects at the same level or one that's higher in the hierarchy to listen to a lower one. As long as your listening handler is lower in the hierarchy then you don't need it. You just need to get your setProp handler if it's a custom property or other message if not to send a command and handle it in the card, stack or library script. Wherever you house your controller script.
More information about the Use-livecode