7. Relationships¶
Relationships are governed by rules and there are different semantics associated with each Relationship type.
Following are the general rules applicable to Relationships:
- Reverse Relationship is not allowed in case of any kind of Relationship type, for example: if Asset A and Asset B have a Relationship, another Relationship between Asset B to Asset A cannot be defined.
- Two Asset Types can have either Association or Classification Relationship between them, for example: if Asset A and Asset B already have an Association Relationship, they cannot have a Classification Relationship simultaneaously.
- There can be any number of Association or Classification Relationships between two Asset Types as long as Relationship Names are unique.
- Two Asset Types can have either Composition or Aggregation Relationship between them, for example: if Asset A and Asset B already have a Composition Relationship, they cannot have an Aggregation Relationship simultaneously.
Following are the semantical differences between each Relationship type:
Classification
Classification is a Relationship where Destination Asset Type’s Instances are independent.
A Destination Asset Type can belong to one or more different Source Asset Types.
If a Source Asset Type is deleted, the Destination Asset Type’s Instances are not deleted.
Creating a Source Asset Type’s Instance version does not create a version for the related Destination Asset Type’s Instance.
Source and Destination Asset Types should not be same.
Association
Association is a Relationship where Destination Asset’s Instances are independent.
A Destination Asset Type can belong to one or more different Source Asset Types.
If a Source Asset Type is deleted, the Destination Asset Type’s Instances are not deleted.
Creating a Source Asset Type’s Instance version does not create a version for the related Destination Asset Type’s Instance.
Source and Destination Asset Types can be same.
Aggregation
Aggregation is a Relationship where Destination Asset’s Instances are not independent.
A Destination Asset Type cannot belong to two different Source Asset Types.
If a Source Asset Type is deleted, all Destination Asset’s Instances are also deleted.
Creating a Source Asset’s Instance version does not create a version for the related Destination Asset’s Instance.
Source and Destination Asset Types should not be same.
While creating an Aggregation Relationship, any Destination Asset’s Instance should not exist.
Composition
Composition is a Relationship where Destination Asset’s Instances are not independent.
A Destination Asset Type cannot belong to two different Source Asset Types.
If Source Asset Type is deleted, all Destination Asset’s Instances are also deleted.
Source and Destination Asset Types both should be versionable.
Creating a Source Asset’s Instance version, creates a version for the related Destination Asset’s Instance as well.
Source and Destination Asset Types should not be same.
While creating a Composition Relationship, any Destination Asset’s Instance should not exist.
The table below explains the semantics taking two Asset Instances A and B as examples.
Scenario | Composition | Aggregation | Classification | Association |
---|---|---|---|---|
If A and B are related and A is deleted | B is also deleted | B is also deleted | B is not deleted | B is not deleted |
If A and B are related and B is deleted | A is not deleted | A is not deleted | A is not deleted | A is not deleted |
If A and B are related and A is versioned | B is also versioned | B is not versioned | B is not versioned | B is not versioned |
In RepoPro, a Relationship definition comprises four elements:
- Relationship Type
- Relationship Name
- Source Asset Type
- Destination Asset Type
For instructions on how to manage Relationships, visit: Manage Relationships.
Relationships are represented in RepoPro using a Relationship Tree, which is a visual representation of an Asset Type’s Relationships with other Asset Types and Instances. To view/edit Relationships, visit: Relationships.