-
Notifications
You must be signed in to change notification settings - Fork 3
Derived Attribute
“A derived attribute is an Attribute whose value can be computed from other attributes already in the model.” MB
To be more specific, a Derived Attribute is computed from other Attributes within the same Domain in a state independent manner in a given slice of time. The first part goes without saying since Attributes in external Domains are always invisible. But the second part is less obvious. It means that all processing necessary to compute the current value of a Derived Attribute happens without the activation of any state transitions. To use one or more state transitions, as is often helpful, to compute an updated value of some Attribute, define that Attribute as a Non Derived Attribute instead.
A Derived Attribute is preceded by the /
character on a class diagram.
Here is an example of a mathematically Derived Attribute on a single Class:
Here, an Identifier is derived by concatenating two subfields:
Referential Attributes and Identifier Attributes within the same or other Classes may contribute in the construction of a Derived Attribute. In fact, a Derived Attribute may be computed based on other Derived Attributes as shown:
In the example above, Aircraft.Flying time
is computed based on Fuel Tank.Quantity
and Aircraft.Consumption rate
. The Consumption rate
itself may be computed based on other performance factors.
A Derived Attribute may not be, to any degree, derived from itself.
- Name + Class + Domain
The algorithm, concatenation or other processing necessary to compute the current value of the Derived Attribute is defined as the formula. For now, this is informal text pending completion of the miUML Action Metamodel subsystem. (Action language will probably be used to specify Formulas in the future). Here are some examples:
Volume = Height * Pi * Radius^2
Code = <Organization>-<Number>
Flying time = self->fueled by->Fuel Tank.Quantity / Consumption rate
The text symbols employed in the above examples are entirely informal.
When is a Derivation executed? In the example above, Flying time
could be computed upon each read access or, instead, each time the fuel quantity
is updated. The choice is entirely implementation specific. Platform performance features must be taken into account to make the right choice. From an analysis perspective, the only thing that matters is that a correct value is obtained whenever /Flying_time
is accessed. Consequently, there is no need to express the time of execution for a Derivation. It suffices to simply associate it with a Derived Attribute.
IMPORTANT: Each Attribute contributing in a Derivation must be instantiated as an Attribute in Derivation for the Derived Attribute. In other words, no Attribute that is not an Attribute in Derivation where the Derived Attribute is the target may be used in the Derived Attribute’s Formula.
Type: Description
Copyright © 2021-2023 Leon Starr