Previous UML Classes Table of Contents UML Packages Next


17.5.19 Property

Templates


*Generalizations

   

    ParameterableElement (from Templates) on page 647

   

    Property (from Kernel , AssociationClasses ) on page 125

   Description

   Property specializes ParameterableElement to specify that a property can be exposed as a formal template parameter, and provided as an actual parameter in a binding of a template.

   Attributes

   No additional attributes

   Associations

   No additional associations

   Constraints

Issue 8592 -replace constraint and add OCL

   [1] A binding of a property template parameter representing an attribute must be to an attribute

   (isAttribute(self) and (templateParameterSubstitution ->notEmpty() implies(templateParameterSubstitution ->forAll(ts | isAttribute(ts.formal)))

   Additional Operations

   [1] The query isCompatibleWith() determines if this parameterable element is compatible with the specified parameterable element. By default parameterable element P is compatible with parameterable element Q if the kind of P is the same or a subtype as the kind of Q. In addition, for properties, the type must be conformant with the type of the specified parameterable element.

   Property::isCompatibleWith(p : ParameterableElement) : Boolean;

   isCompatibleWith = p->oclIsKindOf(self.oclType) and self.type.conformsTo(p.oclAsType(TypedElement ).type)

   Semantics

   A Property may be exposed by a template as a formal template parameter. Within a template a property template parameter may be used as any other property defined in an enclosing namespace. Any references to the property template parameter within the template will end up being a reference to the actual property in the bound element.

   Notation

   See ParameterableElement for a description of the general notation that is defined to support these added capabilities.

   ValueSpecification TemplateParameters

   The ValueSpecification template parameters diagram supports the specification of value specification template parameters.

Figure 17.32 - ValueSpecification template parameters