UML Models and dataAbsentReason
This specification describes the use of the dataAbsentReason attribute, which is used throughout the content models on elements of any type to indicate missing data. The dataAbsentReason attribute "may appear on any element in a resource other than those marked mandatory".
In Object-Orientated paradigms, the dataAbsentReason is a mixin. The definition of a mix-in is that it is an abstract class that provides functionality that is not inherited by specialization but rather by collecting functionality. A mixin can be thought of as a generic class that specializes it's parameter class:
This shows a mixin called "DataQualityAspect" which expresses the attribute "dataAbsentReason". The two derived classes, DataQualityAspectQuantity which inherits both Quantity and DataQualityAspect and DataQualityAspect(Quantity), which binds Quantity to the paramter T on the DataQualityAspect mixin both have the same semantics (are identical other than their type derivation).
The problem with this approach is that not only is the <<mixin>> stereotype not a recognised standard UML sytnax, but most mainstream programming languages cannot implement multiple inheritence in this form. There is two alternative approaches for implementing this in these platforms. The first is using a wrapper class:
The problem with this variation is that Quantity and DataQualityAspect(Quantity) are no longer both types of Quantity, as with a pure mixin, and this will have a series of knock on effects in implementations. The other alternative is simply to make DataQualityAspect a base class:
This is the simplest approach, but has the disadvantage that all instances of the Quantity data type carry the dataAbsentReason attribute, whether it is appropriate or not.
Implementors that use these objects in an environment where mixins are not supported must choose either of these two approaches. For simplicity, the object models defined in this specification simply bind the target type directly to the specified data type, and ignore the issue of the dataAbsentReason mixin.
Note that the dataAbsentReason may also be associated with primitive types as well.
The same issue applies to the transactionFlag attribute.
© 2011