Class UML 2.3::Property
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.
Direct Superclasses: StructuralFeature,
DeploymentTarget,
ConnectableElementDirect Subclasses: Port,
ExtensionEndClass Precedence List: Property,
StructuralFeature,
MultiplicityElement,
DeploymentTarget,
ConnectableElement,
ParameterableElement,
TypedElement,
Feature,
RedefinableElement,
NamedElement,
ElementProperties:
aggregation :
AggregationKind (1 1); -- source
Property association :
Association (0 1); -- source
Property associationEnd :
Property (0 1); -- source
Property class :
Class (0 1); -- source
Property datatype :
DataType (0 1); -- source
Property default : String (0 1); -- source
Property defaultValue :
ValueSpecification (0 1); -- source
Property interface :
Interface (0 1); -- source
Property isComposite : Boolean (1 1); -- source
Property isDerived : Boolean (1 1); -- source
Property isDerivedUnion : Boolean (1 1); -- source
Property isReadOnly : Boolean (1 1); -- source
Property opposite :
Property (0 1); -- source
Property owningAssociation :
Association (0 1); -- source
Property qualifier :
Property (0 *); -- source
Property redefinedProperty :
Property (0 *); -- source
Property subsettedProperty :
Property (0 *); -- source
Property isOrdered : Boolean (1 1); -- source
MultiplicityElement isUnique : Boolean (1 1); -- source
MultiplicityElement lower : Integer (0 1); -- source
MultiplicityElement lowerValue :
ValueSpecification (0 1); -- source
MultiplicityElement upper : UnlimitedNatural (0 1); -- source
MultiplicityElement upperValue :
ValueSpecification (0 1); -- source
MultiplicityElement deployedElement :
PackageableElement (0 *); -- source
DeploymentTarget deployment :
Deployment (0 *); -- source
DeploymentTarget end :
ConnectorEnd (0 *); -- source
ConnectableElement templateParameter :
ConnectableElementTemplateParameter (0 1); -- source
ConnectableElement owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement type :
Type (0 1); -- source
TypedElement featuringClassifier :
Classifier (0 *); -- source
Feature isStatic : Boolean (1 1); -- source
Feature isLeaf : Boolean (1 1); -- source
RedefinableElement redefinedElement :
RedefinableElement (0 *); -- source
RedefinableElement redefinitionContext :
Classifier (0 *); -- source
RedefinableElement clientDependency :
Dependency (0 *); -- source
NamedElement name : String (0 1); -- source
NamedElement nameExpression :
StringExpression (0 1); -- source
NamedElement namespace :
Namespace (0 1); -- source
NamedElement qualifiedName : String (0 1); -- source
NamedElement visibility :
VisibilityKind (0 1); -- source
NamedElement ownedComment :
Comment (0 *); -- source
Element ownedElement :
Element (0 *); -- source
Element owner :
Element (0 1); -- source
ElementConstraints:
Signature: CMOF_14_3_27() : Boolean;
Description: 14.3 [27] A Property typed by a kind of DataType must have aggregation = none.
Expression: type.oclIsKindOf(DataType) implies aggregation = AggregationKind::none
Signature: CMOF_14_3_26() : Boolean;
Description: 14.3 [26] A composite subsetting Property with mandatory multiplicity cannot subset
another composite Property with mandatory multiplicity.
Expression: isComposite and lowerBound() = 1 implies subsettedProperty->forAll(not (isComposite and lowerBound() = 1))
Signature: CMOF_14_3_25b() : Boolean;
Description: 14.3 [25] For a TypedElement that is a kind of Parameter or Property typed by an PrimitiveType,
the defaultValue, if any, must be a kind of LiteralSpecification.
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/typed-element-is-primitive-with-non-literal-default
Expression: type.oclIsKindOf(PrimitiveType) and defaultValue->notEmpty()
implies defaultValue.oclIsKindOf(LiteralSpecification)
Signature: CMOF_14_3_24b() : Boolean;
Description: 14.3 [24] For a TypedElement that is a kind of Parameter or Property typed by an Enumeration,
the defaultValue, if any, must be a kind of InstanceValue.
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/typed-element-is-enumeration-with-non-instance-value-default
Expression: type.oclIsKindOf(Enumeration) and defaultValue->notEmpty() implies defaultValue.oclIsKindOf(InstanceValue)
Signature: CMOF_14_3_23b() : Boolean;
Description: 14.3 [23] A TypedElement that is a kind of Parameter or Property typed by a Class cannot have a default value.
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/typed-element-is-complex-with-default-value
Expression: type.oclIsKindOf(Class) implies defaultValue->isEmpty()
Signature: CMOF_14_3_16() : Boolean;
Description: 14.3 [16] Property::aggregation must be either 'none' or 'composite'
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/property-has-shared-aggregation
Expression: aggregation = AggregationKind::composite or aggregation = AggregationKind::none
Signature: CMOF_14_3_12d() : Boolean;
Description: 14.3 [12] A multi-valued Property or Parameter cannot have a default value.
The default value of a Property or Parameter typed by a PrimitiveType must be a kind of LiteralSpecification.
The default value of a Property or Parameter typed by an Enumeration must be a kind of InstanceValue.
A Property or Parameter typed by a Class cannot have a default value.
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/parameter-has-invalid-default-value
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/property-has-invalid-default-value
Expression: defaultValue->notEmpty() implies
(upperBound() <= 1 and
((type.oclIsKindOf(PrimitiveType) and defaultValue.oclIsKindOf(LiteralSpecification)) or
(type.oclIsKindOf(Enumeration) and defaultValue.oclIsKindOf(InstanceValue))))
Signature: CMOF_14_3_12c() : Boolean;
Description: 14.3 [12] A multi-valued Property or Parameter cannot have a default value.
The default value of a Property or Parameter typed by a PrimitiveType must be a kind of LiteralSpecification.
The default value of a Property or Parameter typed by an Enumeration must be a kind of InstanceValue.
A Property or Parameter typed by a Class cannot have a default value.
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/parameter-has-invalid-default-value
see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/property-has-invalid-default-value
Expression: (upperBound() > 1 or type.oclIsKindOf(Class) implies defaultValue->isEmpty())
Signature: CMOF_14_3_10b() : Boolean;
Description: see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/property-has-qualifier
Expression: qualifier->isEmpty()
Signature: subsetting_rules() : Boolean;
Description: A subsetting property may strengthen the type of the subsetted property,
and its upper bound may be less.
Expression: self.subsettedProperty->forAll(sp |
self.type.conformsTo(sp.type) and
((self.upperBound()->notEmpty() and sp.upperBound()->notEmpty()) implies
self.upperBound()<=sp.upperBound() ))
Signature: subsetting_context_conforms() : Boolean;
Description: Subsetting may only occur when the context of the subsetting property conforms
to the context of the subsetted property.
The OCL used here is not normative.Editor's notes: subsettingContext commented out, thus this cannot be used.
Expression: true
Original: self.subsettedProperty->notEmpty() implies
(self.subsettingContext()->notEmpty() and self.subsettingContext()->forAll (sc |
self.subsettedProperty->forAll(sp |
sp.subsettingContext()->exists(c | sc.conformsTo(c)))))
Signature: subsetted_property_names() : Boolean;
Description: A property may not subset a property with the same name.
Expression: true
Signature: redefined_property_inherited() : Boolean;
Description: A redefined property must be inherited from a more general classifier containing
the redefining property.
The OCL used here is not normative.Editor's notes: Use implies, not if...MIWG: Replaced the body with TRUE, since it appears that redefinitionContext is a derived union with no subsetting properties. Carried over from UML 2.1.1
Expression: true
Original: if (redefinedProperty->notEmpty()) then
(redefinitionContext->notEmpty() and
redefinedProperty->forAll(rp| ((redefinitionContext->
collect(fc| fc.allParents()))->asSet())->collect(c| c.allFeatures())->asSet()->includes(rp))
Signature: navigable_readonly() : Boolean;
Description: Only a navigable property can be marked as readOnly.
The OCL used here is not normative.Editor's notes: isNavigable is commented out. Thus this cannot be used.
Expression: true
Original: isReadOnly implies self.isNavigable()
Signature: multiplicity_of_composite() : Boolean;
Description: A multiplicity on an aggregate end of a composite aggregation must not
have an upper bound greater than 1.
The OCL used here is not normative.Editor's notes: Rewrite supplied by Maged Elaasar, 2011-05-11
Expression: self.isComposite and self.association->notEmpty() implies
let opposite = self.association.memberEnd->any(e|e<>self) in
opposite.upperBound() <= 1
Original: isComposite implies (upperBound()->isEmpty() or upperBound() <= 1)
Signature: derived_union_is_read_only() : Boolean;
Description: A derived union is read only.
Expression: isDerivedUnion implies isReadOnly
Signature: derived_union_is_derived() : Boolean;
Description: A derived union is derived.
Expression: isDerivedUnion implies isDerived
Signature: deployment_target() : Boolean;
Description: A Property can be a DeploymentTarget if it is a kind of Node and functions
as a part in the internal structure of an encompassing Node.
Expression: true
Signature: binding_to_attribute() : Boolean;
Description: A binding of a property template parameter representing an attribute must
be to an attribute.
Editor's notes: templateParameterSubstitution not defined.
Expression: true
Operations:
Signature: subsettingContext() : Type;
Description: The query subsettingContext() gives the context for subsetting a property. It consists, in the case of an attribute, of the corresponding classifier, and in the case of an association end, all of the classifiers at the other ends.
The OCL used here is not normative.Editor's notes: classifier not defined.
Expression: Set{}
Original: result = if association->notEmpty()
then association.endType-type
else if classifier->notEmpty() then Set{classifier} else Set{} endif
endif
Signature: opposite.1() : Property;
Description: If this property is owned by a class, associated with a binary association, and the other end of the association is also owned by a class, then opposite gives the other end.
The OCL used here is not normative.Editor's notes: excluding() not -.
Added additional 'AND association->notEmpty()' to cut off case where self.association is empty.
Expression: result = if owningAssociation->isEmpty()
and association->notEmpty()
and association.memberEnd->size() = 2
then
let otherEnd = (association.memberEnd->excluding(self))->any() in
if otherEnd.owningAssociation->isEmpty() then otherEnd else Set{} endif
else Set {}
endif
Original: result = if owningAssociation->isEmpty()
and association.memberEnd->size() = 2
then
let otherEnd = (association.memberEnd - self)->any() in
if otherEnd.owningAssociation->isEmpty() then otherEnd else Set{} endif
else Set {}
endif
Signature: isNavigable() : Boolean;
Description: The query isNavigable() indicates whether it is possible to navigate across the property.
Expression: result = not classifier->isEmpty() or association.owningAssociation.navigableOwnedEnd->includes(self)
Signature: isConsistentWith(redefinee : RedefinableElement; ) : Boolean;
Description: The query isConsistentWith() specifies, for any two Properties in a context in which redefinition is possible, whether redefinition would be logically consistent. A redefining property is consistent with a redefined property if the type of the redefining property conforms to the type of the redefined property, the multiplicity of the redefining property (if specified) is contained in the multiplicity of the redefined property, and the redefining property is derived if the redefined property is derived.
The OCL used here is not normative.Editor's notes: Term testing upper bound needs to reference upperBound() not lowerBound().
Expression: result = redefinee.oclIsKindOf(Property) and
let prop : Property = redefinee.oclAsType(Property) in
(prop.type.conformsTo(self.type) and
((prop.lowerBound()->notEmpty() and self.lowerBound()->notEmpty()) implies prop.lowerBound() >= self.lowerBound()) and
((prop.upperBound()->notEmpty() and self.upperBound()->notEmpty()) implies prop.upperBound() <= self.upperBound()) and
(self.isDerived implies prop.isDerived) and
(self.isComposite implies prop.isComposite))
Original: result = redefinee.oclIsKindOf(Property) and
let prop : Property = redefinee.oclAsType(Property) in
(prop.type.conformsTo(self.type) and
((prop.lowerBound()->notEmpty() and self.lowerBound()->notEmpty()) implies prop.lowerBound() >= self.lowerBound()) and
((prop.upperBound()->notEmpty() and self.upperBound()->notEmpty()) implies prop.lowerBound() <= self.lowerBound()) and
(self.isDerived implies prop.isDerived) and
(self.isComposite implies prop.isComposite))
Signature: isComposite.1() : Boolean;
Description: The value of isComposite is true only if aggregation is composite.
Expression: result = (self.aggregation = #composite)
Signature: isCompatibleWith(p : ParameterableElement; ) : Boolean;
Description: 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.
Expression: result = p->oclIsKindOf(self.oclType()) and self.type.conformsTo(p.oclAsType(TypedElement).type)
Signature: isAttribute(p : Property; ) : Boolean;
Description: The query isAttribute() is true if the Property is defined as an attribute of some classifier.
The OCL used here is not normative.Editor's notes: allInstances() not allInstances
Expression: result = Classifier.allInstances()->exists(c | c.attribute->includes(p))
Original: result = Classifier.allInstances->exists(c | c.attribute->includes(p))
Send questions or comments to
[email protected].