Why Chained Behaviors May Be A Bad Idea

Sannyasin Brahmanathaswami brahma at hindu.org
Mon Sep 12 11:15:24 EDT 2016


Mark Wieder" wrote:

    Well, most of the article rants about multiple inheritance, which is 
    indeed a bad idea. But of course you know that's different from chained 
    behaviors, so no worries there.

BR: actually I don't know how that is different, probably I just don't understand it well enough, if I did, perhaps I would not be afraid of it. Backscripts are "easy" but I am seeing instances where better encapsulation will help avoid issues and if some functions truly are not needed globally then a strong case could be made to use behaviors for specific event sequences.

In our current app, we are using independent modules(stacks) that use global functions in the loader stack and a core API backscript (and a few others)

But some of these modules are so unique that requirements for Module Y will never appear as a requirement for Modules A, B, C (separate stacks)

Theoretically I could have (I will declare these as objects, but of course now we can also use livecodescript text only stacks)

Behavior_button A  

Behavior Buttons B and C
	# both have behavior A assigned

Button D 
   # with button C assigned as behavior

How is this not "inheritance"?







More information about the use-livecode mailing list