Class UML 2.4.1::Property
Description:
Property represents a declared state of one or more instances in terms
of a named relationship to a value or values. When a property is an attribute
of a classifier, the value or values are related to the instance of the
classifier by being held in slots of the instance. When a property is an
association end, the value or values are related to the instance or instances
at the other end(s) of the association. The range of valid values represented
by the property can be controlled by setting the property's type.A property
is a structural feature of a classifier that characterizes instances of
the classifier. A property related by ownedAttribute to a classifier (other
than an association) represents an attribute and might also represent an
association end. It relates an instance of the class to a value or set
of values of the type of the attribute. A property related by memberEnd
or its specializations to an association represents an end of the association.
The type of the property is the type of the end of the association.A property
has the capability of being a deployment target in a deployment relationship.
This enables modeling the deployment to hierarchical nodes that have properties
functioning as internal parts.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.A property
represents a set of instances that are owned by a containing classifier
instance.
Direct Superclasses: StructuralFeature,
ConnectableElement,
DeploymentTargetDirect Subclasses: Port,
ExtensionEndClass Precedence List: Property,
StructuralFeature,
ConnectableElement,
TypedElement,
ParameterableElement,
MultiplicityElement,
Feature,
RedefinableElement,
DeploymentTarget,
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 isID : 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 end :
ConnectorEnd (0 *); -- source
ConnectableElement templateParameter :
ConnectableElementTemplateParameter (0 1); -- source
ConnectableElement type :
Type (0 1); -- source
TypedElement owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement 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 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 deployedElement :
PackageableElement (0 *); -- source
DeploymentTarget deployment :
Deployment (0 *); -- source
DeploymentTarget 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: multiplicity_of_composite() : Boolean;
Description: A multiplicity on an aggregate end of a composite aggregation must not
have an upper bound greater than 1. A multiplicity 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.
The OCL used here is not normative.Editor's notes: templateParameterSubstitution not defined.
Expression: true
Original: (isAttribute(self) and (templateParameterSubstitution->notEmpty()) implies (templateParameterSubstitution->forAll(ts | isAttribute(ts.formal)))
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. 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, and the multiplicity
of the redefining property (if specified) is contained in the multiplicity
of the redefined property.
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: redefinee.isRedefinitionContextValid(self)
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.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].