From element in mapping should include extended model elements

Issue #309 resolved
Matthias Schoettle created an issue

When selecting the from element in a classifier mapping, only the classes from the instantiated aspect are shown.

Steps to reproduce:

  1. Open the Association concern
  2. Make sure that the Association aspect has a reference to Collection (empty class)
  3. Open the ArrayList aspect and in the instantiation for Ordered, create a ClassifierMapping and attempt to select the from element

The selector will only show |Data, but should also show classes from extended aspects higher up the hierarchy. This only applies to instantiations that are of type Extends.

Comments (15)

  1. Matthias Schoettle reporter

    This leads to the following problem:

    Consider the Association concern and the following facts: There is a class Collection in Association and ArrayList (extends Ordered, which extends Association) maps Collection to ArrayList<...>.

    If woven, the result will contain both Collection and ArrayList<...>, because after weaving ArrayList into Ordered, the mapping is lost.

    I see two posibilities:

    • we don't allow to select elements from other extended aspects. Instead, the extended aspect must propagate/delegate the fact that a concrete class needs to be provided for Collection (in line with the concern partiality)
    • the weaver detects that an element from another aspect is mapped and adds that mapping to the extension of the aspect

    @djeminy: What do you think?

  2. Jörg Kienzle

    Unfortunately I think we have to go with option 2. Otherwise, the designer of the "middle" feature, in our example "Ordered", would have to guess which classes could possibly be mapped in child features. In general I think this is not possible.

  3. Matthias Schoettle reporter

    Hm, I thought it would be the same person, because it is within a concern (i.e., the concern designer).

  4. Matthias Schoettle reporter
    • changed status to open

    Unmapped operations (that are concern partial) from extended aspects should, however, be shown.

    E.g., in Association the operations of Data are incrementally added throughout the hierarchy, and, in the leaf features, all operations are mapped to the actual operations.

  5. Matthias Schoettle reporter
    • changed status to open

    As discussed in our meeting today, it should be possible to map elements within the extends hierarchy (within a concern). And the weaver needs to handle it accordingly. See #435 for more information.

  6. Matthias Schoettle reporter

    I think it makes most sense to incorporate this into COREMappingItemProvider and make use of the ModelExtensions, so it requires the metamodel to be updated first.

  7. Matthias Schoettle reporter

    See COREMappingItemProvider and COREModelUtil.collectExtendedModels(COREModel) or COREModelUtil.collectModelExtensions(COREModel).

  8. Log in to comment