• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Inheritance

Using child objects is an excellent way of handling numerous related items. But where OOP really starts paying dividends is when you introduce inheritance into the project. In some respects, we already have inheritance: You can say that each child object inherits the properties and handlers of the parent script. But the chain of inheritance can go back still further, to preceding generations.

In Director, inheritance is implemented using ancestor scripts. When a parent script has an ancestor, the properties and handlers of that ancestor are available to the parent and its child objects, plus the ancestor can have an ancestor, and so on. Elements of each ancestor are available to every element below them in the hierarchy (all of their descendants).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint