Why Chained Behaviors May Be A Bad Idea

Sannyasin Brahmanathaswami brahma at hindu.org
Mon Sep 12 16:00:28 EDT 2016


Mark Weider wrote:

    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


BR: right, you can't do that… 

but the example was  

Parent X (a behavior for)
    Child Y and Child X, 
where Child X was also a behavior for 
     Child A

    
Mark:    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.

BR: Ahha!  that's an important point/option.

Thanks for listening… I learned something there.




More information about the use-livecode mailing list