Chained Behaviors

Peter Haworth pete at lcsql.com
Fri Jul 12 16:04:35 EDT 2013


On Fri, Jul 12, 2013 at 11:40 AM, Scott Rossi <scott at tactilemedia.com>wrote:

> have built a system that uses one behavior for a wide range of controls
> using switch statements, and the higher the number of controls you have to
> support, the more complex and messier the code gets.  Chained behaviors
> gives you another option to modularize your code.
>

Good point Scott.  Switch statements definitely get messy when they have a
large number of case statements within them.

I think this is coming down to the fact that I personally haven't come
across a situation where chained behaviors would have been useful or there
wasn't a perfectly acceptable alternative, at least for my programming
style.

I think one of the things that concerns me is the relative invisibility of
behaviors, resulting in it sometimes being hard to track down where things
happen, especially if you're looking at someone else's code.  Heck, the IDE
Inspector doesn't even show a behavior field for some object types so
tracking down the fact that a behavior is in effect is hard enough at a
single level never mind multiple levels.  At least if you write a common
handler and call it from each control's script, you can see right in front
of you.

Pete
lcSQL Software <http://www.lcsql.com>



More information about the use-livecode mailing list