Previous UML Classes Table of Contents UML Packages Next


17.5.8 ClassifierTemplateParameter

Templates


   A classifier template parameter exposes a classifier as a formal template parameter.

*Generalizations

   

    TemplateParameter (from Templates) on page 653

   Description

   ClassifierTemplateParameter is a template parameter where the parametered element is a Classifier in its capacity of being a kind of ParameterableElement.

   Attributes

   • allowSubstitutable : Boolean[1] Constrains the required relationship between an actual parameter and the parameteredElement for this formal parameter. Default is true.

   Associations

   • parameteredElement : Classifier[1] The parameterable classifier for this template parameter. Redefines TemplateParameter::parameteredElement.

Issue 8265 -add constrainingClassifier and defaultClassifier items

   Constraints

Issue 8265 -add new constraint

   [1] If allowSubstitutable is true, then there must be a constrainingClassifier

    allowSubstitutable implies constrainingClassifier->notEmpty()

   Semantics

   See Classifier for additional semantics related to the compatibility of actual and formal classifier parameters.

   Notation

   A classifier template parameter extends the notation for a template parameter to include an optional type constraint: <classifier-template-parameter> ::= <parameter-name> [ ‘:‘ <parameter-kind> ] [‘>’ <constraint>] [‘=’ <default>] <constraint> ::= [‘{contract }’] <classifier-name> <default> ::= <classifier-name> The parameter-kind indicates the metaclass of the parametered element. It may be suppressed if it is ‘class’.

Issue 8528 - replace ‘allowsSubstitutable’ with ‘allowSubstitutable’

   The classifier-name of constraint designates the type constraint of the parameter, which reflects the general classifier for the parametered element for this template parameter. The ‘contract’ option indicates that allowSubstitutable is true, meaning the actual parameter must be a classifier that may substitute for the classifier designated by the classifier-name. A classifier template parameter with a constraint but without ‘contract’ indicates that the actual classifier must be a specialization of the classifier designated by the classifier-name.

   Examples

   See Classifier.