Chained Behaviors

Richmond richmondmathewson at gmail.com
Fri Jul 12 16:24:28 EDT 2013


On 07/12/2013 08:58 PM, Richard Gaskin wrote:
> Peter Haworth wrote:
>> Has anyone got any real world examples of the benefits of the new 
>> chained
>> behaviors feature?
>>
>> I just read the latest newsletter article about them and while I 
>> understand
>> the concept,  I didn't see benefit in the example scenario over a single
>> behavior with some common logic and a switch statement to handle the 
>> logic
>> specific to each "sprite".
>
> It obviates the switch statement.

And what, pray tell, is wrong with switch statements?

My "main thing" works on switch statements with nary a backward glance.

Richmond.

>
> We could take this question one step back and ask why we'd want 
> behaviors at all, when we could just use frontScripts with switch 
> statements instead.
>
> But that thought experiment (hopefully) makes the case for behaviors 
> clear.
>
> Nested behaviors simply extend the value of such a mechanism, at long 
> last giving xTalk one of the most valuable aspects of OOP: subclasses.
>
> -- 
>  Richard Gaskin
>  Fourth World
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  Follow me on Twitter:  http://twitter.com/FourthWorldSys
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list