Chapter 9 Generation Reference Guide (GTL)


Defining inheritance

Templates are defined with respect to a given metamodel class and are inherited by its children. They are inherited by all the children of the metaclass they are defined for. This mechanism is useful for sharing template code between metaclasses having a common parent.

Example

Example of inheritance: Classifier/definition is available through inheritance of Class and Interface. In the following example, the definition template defined on the parent metaclass is used in the evaluation of the content template on the child metaclass.


 


Copyright (C) 2005. Sybase Inc. All rights reserved.