Mapped operations not merged in woven model

Issue #435 new
Céline Bensoussan created an issue

In the ArrayList feature of the Association concern, , I create an classifier mapping from CollectionOfAssociated to ArrayList<|Associated> and then an operation mapping from create() to ArrayList(). The operations are not merged in the woven model.

Expected result: The implementation class in the woven model should not have the operation create()

Comments (8)

  1. Matthias Schoettle

    I tried it on my current branch, which is based on master from last week and it worked. Can you try it with master and report whether the problem also exists there for you, please?

  2. Céline Bensoussan reporter

    I merged master in my branch and I still get this problem. I added the constructor to CollectionOfAssociated in the feature Many, could you also try it this way ?

    feature_many.png

  3. Matthias Schoettle

    Okay, when it is defined in Many it doesn't work. Because (for example, in the case of ArrayList) ArrayList gets woven into Ordered first, and the result of that does not contain the create method anymore.

    I'm not sure what the best solution for this would be. Since create is defined in Many it should keep that mapping until it weaves Many in. This means the weaver would have to weave only mappings where the from element is for the source model. However, it might also change depending on the result of the renaming discussion we are currently having.

    So if we go with the rule that all elements have to exist in the model, the create method would have to be "propagated" down, i.e., each "submodel" of Many would have to re-declare create.

    Although, aren't there other methods that are declared in higher models and get merged fine?

  4. Matthias Schoettle

    The OperationsWeaver checks whether any unmapped operation already exists and first checks by name. Since at that point there is CollectionOfAssociated.create (from Many) and ArrayList.ArrayList (from weaving upwards from ArrayList), their names do not match and it is considered not mapped.

  5. Matthias Schoettle

    I thought it is actually the same problem that I faced in #365 (pull request #79), where I had to create the class again in lower-level models until the leafs map it.

    However, as part of #388, operation mappings can also map a from from the extended hierarchy. If this should really be possible, the weaver would need to handle it separately. But then I don't see why the ClassifierMapping shouldn't have this functionality too.

  6. Matthias Schoettle

    As discussed in our meeting today, it is okay to do this. I.e., mapping within the extends hierarchy is okay and the weaver needs to be able to handle this.

    So the changes in #309 need to be either reverted or updated. And the weaver needs to be updated to handle mappings to higher lying elements properly. I.e., they should be kept and not be deleted.

  7. Log in to comment