Mapped operations not merged in woven model
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)
-
-
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 ? -
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-declarecreate
.Although, aren't there other methods that are declared in higher models and get merged fine?
-
The
OperationsWeaver
checks whether any unmapped operation already exists and first checks by name. Since at that point there isCollectionOfAssociated.create
(from Many) andArrayList.ArrayList
(from weaving upwards from ArrayList), their names do not match and it is considered not mapped. -
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. -
-
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
#309need 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. -
- removed responsible
- Log in to comment
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?