Hide Comments

Reference properties are denoted by the reference keyword. A Reference Property refers to an instance of a specified Data Structure in the same Data Model or in an imported Data Model.

Syntax

<property-name> : [~as] [containing] reference [~to] <referenced-structure> [inverse <inverse-reference>][<cardinality-indicator>]

Examples

structure TaxFiling

taxpayer : as reference to Person inverse taxfiling

 

structure Person

taxfiling : as reference to TaxFiling inverse taxpayer

homeAddress : as containing reference to Address

workAddress :as reference to Address

 

structure Address

Parameters

Field Name

Type

Description

<property-name>

Name

The name assigned to this property.

containing

keyword

Indicates that the referenced object is contained by the referring object. See the discussion below for more information.

<referenced-structure>

QName(Data Structure)

The target of this Reference Property.

<inverse-reference>

SName(Reference Property)

Specifies a Reference Property in the referenced Data Structure that forms a bi-directional association with the referring Data Structure. See the discussion below for more information.

Child Elements

None.

Parent Elements

Data Structure

Discussion

Containing

The optional containing keyword indicates a whole/part relationship, where the referenced object is contained by the referring object. The reference should be managed at runtime to enforce UML composition semantics, namely:

An instance of the contained structure can have at most one container at a time. It cannot be referenced simultaneously through more than one containing reference, even if those containing references are defined separately.
If a composite is deleted, all of its parts are normally deleted with it.

Note that it is up to the application to enforce the above semantics at runtime. Generated code SHOULD enforce containment semantics where such enforcement is a natural part of the scope of the generated code; but this is generally not sufficient to guarantee these semantics.

Inverse

The inverse keyword means that the reference guarantees consistency in the following forms:

In the simplest case, starting with object O1, traversing the association through its reference R1 yields an object O2 whose specified inverse reference R2 yields O1.
One or both of the references may be multi-valued (Cardinality 0..* or 1..*). In this case:
oStarting with object O1, traversing a multi-valued inverse reference R1 yields a set of objects, each of which refers back to O1 through its inverse reference R2.
oR2 refers back to O1 if:
(a) R2 is a single-valued reference whose value is O1; or
(b) R2 is a multi-valued reference, at least one of whose values is O1.

The inverse keyword is only valid if it meets the following conditions:

inverse must be specified on both ends of the association.
The inverse properties must be reciprocal, such that the named reference properties on each side of the association refer to each other.
The types of the references must be consistent.

To summarize: If Structure S1 defines a reference R1 to structure S2, declared as an inverse of Reference Property R2, then S2 must define the reference R2 to S1, declared as an inverse of Reference Property R1.

Created with Help & Manual 6 and styled with Premium Pack Version 2.51 © by EC Software