next up previous contents
Next: Arithmetic and Aggregate Up: Derived Attributes and Previous: Derived Attributes and

Derived Attributes

Derived attributes are associated with an object or a protocol class and are derived from other attributes using a derivation rule. An attribute can be associated with at most one derivation rule, an optional attribute description, an optional attribute example specification, and an optional list of domain-specific properties. Domain-specific properties are specified as tag-value pairs and are meant to be interpreted by application-specific software.

There are four types of derivation rules:

  1. arithmetic expression involving other attributes: the derived simple attribute is computed using an arithmetic expression involving arithmetic operators, constants, and other numeric attributes of the same object or protocol class;

  2. aggregate functions involving other attributes: the derived simple attribute is computed by applying an aggregate function (min, max, sum, average) on a numeric attribute of the same object or protocol class, or by counting the values of another attribute of the same object or protocol class;

  3. attribute composition: the derived simple attribute is constructed by composing existing attributes;

  4. user specified derivation: the derived simple or tuple attribute is computed using a (or multiple) user specified retrieval method(s) which can be an ad-hoc SQL queries.

A user specified derived attribute can be a simple attribute or a tuple attribute. Only simple derived attribute can be associated with arithmetic expression, aggregate function, or attribute composition derivation.

A derived attribute cannot be specified as an identifier of an object or protocol class, nor as input or output of a protocol class.

<derived attribute> ::= ATTRIBUTE <simple attribute name>
                        DERIVATION : <simple attribute derivation>
                        <attribute description>
                        <domain-specific properties>
                      | ATTRIBUTE <tuple attribute name>
                        ( <comp attribute list> )
                        DERIVATION : userspecified
                        <attribute description>
                        <domain-specific properties>
                      ;
<simple attribute derivation> ::= = <arithmetic expression>
                                | <aggregate expression>
                                | <attribute composition>
                                | userspecified
                                ;