Why Chained Behaviors May Be A Bad Idea

mwieder ahsoftware at sonic.net
Mon Sep 12 15:37:07 EDT 2016


Sannyasin Brahmanathaswami wrote
> 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"?

That is indeed classical inheritance.
Multiple inheritance is properly not allowed in LiveCode and would look like
this

Behavior_button A  

Behavior Button B

Behavior Button C
	# has both button A and button B assigned as behaviors
        # not chained, but in parallel

Inheritance (behaviors) in LiveCode *allow* you to use functionality in
parent objects, but don't force you to do so. And you can override the
parent behaviors by placing handlers of the same name in the child object.

-- 
 Mark Wieder
 ahsoftware at gmail.com





-----
-- 
 Mark Wieder
 ahsoftware at gmail.com
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Why-Chained-Behaviors-May-Be-A-Bad-Idea-tp4708303p4708332.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list