Chapter 9 Generation Reference Guide (GTL)


Defining template overriding

Overriding a template means that a template defined with respect to a given metaclass may be redefined on a child class, in this case the template of the parent metaclass is said to be overridden. The new definition effectively hides the previous one for objects of the child metaclass. You can view the overridden parent using the Go to super-definition command in the child class contextual menu.

In order to use the definition of a specific parent metaclass, GTL provides the "::" qualifying operator:

Example


The same template name "isAbstract" is used in two different categories: Classifier and Class. "false" is the original value that has just been overridden by the new "true" value. You retrieve the original value back by using the following syntax: <metaclassName::template>, in this case:

%isAbstract%
%Classifier::isAbstract%

 


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