Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Behaviors for proxy contained in containment feature after
Behaviors for proxy contained in containment feature after [message #1818549] Thu, 19 December 2019 11:01 Go to next message
Vincent Aranega is currently offline Vincent AranegaFriend
Messages: 10
Registered: July 2009
Junior Member

Hi all,

I'm asking myself a lot of questions about the EMF behavior when it has to deal with proxy contained in a containment feature.

Let say I have an object A, contained by an object ACont in a resource R2 and, in a resource R1, an object B that contains a proxy towards A. If I understood correclty, the proxy towards A should be resolved, so A should be now contained by B in R1 resource and not by ACont anymore?

I found UML models that have a Package in a "first.uml" file that have a href towards a Class in "second.uml". This Class instance owns Property instances that are linked to Association instances in "first.uml". The UML editor seems to load it, but when I save any modifications, it kinda duplicate the Class instance in "first.uml". I'm not sure what should be the wanted behavior.

Thanks for your help!


Re: Behaviors for proxy contained in containment feature after [message #1818550 is a reply to message #1818549] Thu, 19 December 2019 11:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
It's not valid to contain an object in more than one container. In a serialization it's possible to specify inconsistent state, but resolving a containment proxy will only set the container if the container is null. I can't comment on the designed or behavior of the UML2 model...

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Behaviors for proxy contained in containment feature after [message #1818551 is a reply to message #1818550] Thu, 19 December 2019 11:41 Go to previous messageGo to next message
Vincent Aranega is currently offline Vincent AranegaFriend
Messages: 10
Registered: July 2009
Junior Member

Hi Ed,

Thanks for the answer, it's what I was thinking, the model is not correct. I will try to deal with that then.
Does it means that this proxy will remain unresolved?


Re: Behaviors for proxy contained in containment feature after [message #1818552 is a reply to message #1818551] Thu, 19 December 2019 13:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
No, it will resolve, but the state is confusingly wrong.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Behaviors for proxy contained in containment feature after [message #1818553 is a reply to message #1818552] Thu, 19 December 2019 13:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

IMHO what you have could be considered to be a Package Merge which was a serious part of UML 1 but deprecated in UML 2. My understanding is that Eclipse UML provided the first/only implementation of Package Merge and the solutions that Eclipse UML pioneered just encouraged the deprecation for UML 2.5 rather than any fix of the problems.

But as always without a model and possibly an indication of how it came to be created, it is difficult to be sure about semi-guessed / semi-prejudiced responses.

(My UML models regularly have PrimitiveTypes contained in each of a number of package merge fragments. Again IMHO PrimitiveTypes (and other synthesized types such as OCL's collection/tuples/...) have no namespace, consequently Set<String> may be contained as My::Set<My::String> and again as Your::Set<Your::String>; both are the same type as the normalized Set<String> type. In Java we have multiple descriptions of the specialized type that we require; e.g. Set<String>; Java resolves the multiple descriptive references o one definition. Unfortunately in UML, each usage has to create a concrete instance of the specialization in order to reference it. Ecore is much more like Java with each EGenericType able to describe a possibly repeated specialization.)

Regards

Ed Willink

Re: Behaviors for proxy contained in containment feature after [message #1818557 is a reply to message #1818553] Thu, 19 December 2019 14:45 Go to previous message
Vincent Aranega is currently offline Vincent AranegaFriend
Messages: 10
Registered: July 2009
Junior Member

Thanks a lot Ed for the insight!
Indeed, you are totally right, I think the models are a bunch of UML2 with other versions, all bound together, so what you are saying makes perfectly sense. The work for me will be to be able to deal with them without modifying them then.


Previous Topic:Adding feature to dynamic instance model
Next Topic:Fail to get inherited EAttribute with Resource.getObject(String uriFragment)
Goto Forum:
  


Current Time: Fri Mar 29 14:11:52 GMT 2024

Powered by FUDForum. Page generated in 0.05465 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top