Extended Collections and Compositions (Profile)

Extended collections define the possibility to associate an object instance with a group of other objects of the specified type. Extended compositions define a parent-child connection between an object instance and a group of sub-objects derived from the ExtendedSubObject metaclass.

For extended collections, the association between the parent and child objects is relatively weak, so that if you copy or move the parent object, the related objects are not copied or moved, but the connection is maintained (using shortcuts if necessary). For example, you could associate documents containing use case specifications with the different packages of a model by creating an extended collection under the Package metaclass and specifying FileObject as the target metaclass.

For extended compositions, the association is stronger. Sub-objects can only be created within the parent object and are moved, copied, and/or deleted along with their parent.

The collection or composition is displayed as a new tab in the object instance property sheet. The property sheets of objects referenced in a collection show the object instance owning the collection on their Dependencies tab.

  1. Right-click a metaclass, stereotype, or criterion and select New > Extended Collection or Extended Composition.
    Note: If you define the collection or composition under a stereotype or criterion, its tab is displayed only if the metaclass instance bears the stereotype or meets the criterion.
  2. Enter the following properties as appropriate:

    Property

    Description

    Name

    Specifies the name of the extended collection or composition.

    Label

    Specifies the display name of the collection, which will appear as the name of the tab associated with the collection in the parent object property sheet.

    Comment

    [optional] Describes the extended collection.

    Inverse Name

    [extended collection only] Specifies the name to appear in the Dependencies tab of the target metaclass. If you do not enter a value, an inverse name is automatically generated.

    Target Type

    Specifies the metaclass whose instances will appear in the collection.

    For extended collections, the list displays only metaclasses that can be directly instantiated in the current model or package, such as classes or tables, and not sub-objects such as class attributes or table columns. Click the Select a Metaclass tool to the right of this field to choose a metaclass from another type of model.

    For extended compositions, only the ExtendedSubObject is available, and you must specify a stereotype for it.

    Target Stereotype

    [required for extended compositions] Specifies a stereotype to filter the target type. You can select an existing stereotype from the list or click the Create tool to the right of this field to create a new one.

    List Columns

    Specifies the property columns that will be displayed by default in the parent object property sheet tab associated with the collection. Click the Customize Default Columns tool to the right of this field to add or remove columns.

  3. Click Apply to save your changes.


    You can view the tab associated with the collection by opening the property sheet of a metaclass instance. The tab contains an Add Objects (and, if the metaclass belongs to the same type of model, Create an Object) tool, to populate the collection.
    Note: When you open a model containing extended collections or compositions and associate it with a resource file that does not support them, the collections are still visible in the different property sheets in order to let you delete objects in the collections no longer supported.