I am bit confused between 'o' and '-->' used in Model file, For example :
asset Field identified by assetId {
o String assetId
o Customer owner
--> Customer custId
}
participant Customer identified by customerId {
o String customerId
}
what is difference between "o Customer owner" and "--> Customer custId"?
The
o
indicates that this is ano
wned property of a class. Aka a "field". That means that when the instance of the class is removed, so are all its properties.The
-->
indicates that this is a relationship to another addressable resource. Aka a pointer or primary/foreign key entity relationship.In your example, your asset
Field
has a property or typeCustomer
called owner. When instances ofField
are deleted the instances ofCustomer
that they are storing in the owner property are also deleted.The
Field
asset also has a relationship to aCustomer
instance stored in a property calledcustId
. Deleting an instance of Field will not delete the instance ofCustomer
that is being pointed to by the relationship.Composer relationships are essentially typed-pointers. They are a fully-qualified type name of the resource that is being pointed to, as well as the identified of the instance that is being pointed to.
In Composer relationships do not cascade-delete, and there is no referential integrity checking for relationships. It is up to the application to check whether the resource that is at the end of a relationship exists or not, and to respond appropriately.
Note that in the future we may prevent using
o
with assets and participants. It really doesn't make much sense and is confusing for people that expect to find them in their respective registries. For assets and participants people should use-->
.