Skip to main content



      Home
Home » Modeling » EMF » multiple containment reference
multiple containment reference [message #409869] Wed, 06 June 2007 05:40 Go to next message
Eclipse UserFriend
Hi all,

when i try to use a containment reference, model i refer are removed
from it's location to be copied under the containment reference.

what i would like is to re-use some models. So i use the "Load
ressources..." menu, and make a containment reference to the new loaded
model.

Maybe it's better to use a non-containment reference for what i need,
but i need ta have a new instance of the model i refer, not a shared
instance.

can someone give me links to litterature or some help :)

thanks you
Re: multiple containment reference [message #409879 is a reply to message #409869] Wed, 06 June 2007 08:43 Go to previous messageGo to next message
Eclipse UserFriend
RJ,

Maybe cross resource containment support is what you want. You need to
enable "Containment Proxies" to support this, and in that case, any
containment EReference for which isResolveProxies is true will allow the
contained objects to also be contained by a separate resource. But this
does not support sharing and an object that's contained by another
object will still be removed from that other object because for an
object referenced by a containment reference, it can still only have one
eContainer. So if you really need to share the objects, you must use
non-containment reference. I'm not sure what you point you at in terms
of help. You basically have two choices, containment references and
non-containment references. When you use the later, you'll need to make
sure the referenced objects are at least contained somewhere, minimally
as the root object of some resource. There's no much else to say...


Judicael Ribault wrote:
> Hi all,
>
> when i try to use a containment reference, model i refer are removed
> from it's location to be copied under the containment reference.
>
> what i would like is to re-use some models. So i use the "Load
> ressources..." menu, and make a containment reference to the new
> loaded model.
>
> Maybe it's better to use a non-containment reference for what i need,
> but i need ta have a new instance of the model i refer, not a shared
> instance.
>
> can someone give me links to litterature or some help :)
>
> thanks you
Re: multiple containment reference [message #409888 is a reply to message #409879] Wed, 06 June 2007 09:30 Go to previous messageGo to next message
Eclipse UserFriend
ok thank you Ed,

i try to set "Containment Proxies = true", and set "isResolveProxies =
true" on the Ereference attribute, but when i try, the object is removed
from his location ...
what is wrong ?

regards, RJ

Ed Merks wrote:
> RJ,
>
> Maybe cross resource containment support is what you want. You need to
> enable "Containment Proxies" to support this, and in that case, any
> containment EReference for which isResolveProxies is true will allow the
> contained objects to also be contained by a separate resource. But this
> does not support sharing and an object that's contained by another
> object will still be removed from that other object because for an
> object referenced by a containment reference, it can still only have one
> eContainer. So if you really need to share the objects, you must use
> non-containment reference. I'm not sure what you point you at in terms
> of help. You basically have two choices, containment references and
> non-containment references. When you use the later, you'll need to make
> sure the referenced objects are at least contained somewhere, minimally
> as the root object of some resource. There's no much else to say...
>
>
> Judicael Ribault wrote:
>
>> Hi all,
>>
>> when i try to use a containment reference, model i refer are removed
>> from it's location to be copied under the containment reference.
>>
>> what i would like is to re-use some models. So i use the "Load
>> ressources..." menu, and make a containment reference to the new
>> loaded model.
>>
>> Maybe it's better to use a non-containment reference for what i need,
>> but i need ta have a new instance of the model i refer, not a shared
>> instance.
>>
>> can someone give me links to litterature or some help :)
>>
>> thanks you
Re: multiple containment reference [message #409895 is a reply to message #409888] Wed, 06 June 2007 10:05 Go to previous messageGo to next message
Eclipse UserFriend
RJ,

This property will only allow you to contain within an EObject another
EObject that itself is contained by a different resource. It has no
impact on the fact that an EObject contained by another EObject will be
removed from that EObject when it's contained by another EObject later.


Judicael Ribault wrote:
> ok thank you Ed,
>
> i try to set "Containment Proxies = true", and set "isResolveProxies =
> true" on the Ereference attribute, but when i try, the object is
> removed from his location ...
> what is wrong ?
>
> regards, RJ
>
> Ed Merks wrote:
>> RJ,
>>
>> Maybe cross resource containment support is what you want. You need
>> to enable "Containment Proxies" to support this, and in that case,
>> any containment EReference for which isResolveProxies is true will
>> allow the contained objects to also be contained by a separate
>> resource. But this does not support sharing and an object that's
>> contained by another object will still be removed from that other
>> object because for an object referenced by a containment reference,
>> it can still only have one eContainer. So if you really need to
>> share the objects, you must use non-containment reference. I'm not
>> sure what you point you at in terms of help. You basically have two
>> choices, containment references and non-containment references. When
>> you use the later, you'll need to make sure the referenced objects
>> are at least contained somewhere, minimally as the root object of
>> some resource. There's no much else to say...
>>
>>
>> Judicael Ribault wrote:
>>
>>> Hi all,
>>>
>>> when i try to use a containment reference, model i refer are removed
>>> from it's location to be copied under the containment reference.
>>>
>>> what i would like is to re-use some models. So i use the "Load
>>> ressources..." menu, and make a containment reference to the new
>>> loaded model.
>>>
>>> Maybe it's better to use a non-containment reference for what i
>>> need, but i need ta have a new instance of the model i refer, not a
>>> shared instance.
>>>
>>> can someone give me links to litterature or some help :)
>>>
>>> thanks you
Re: multiple containment reference [message #409901 is a reply to message #409895] Wed, 06 June 2007 10:55 Go to previous messageGo to next message
Eclipse UserFriend
ok i see the Controll... menu in the popup.

i'am able to build a model in a specific resource.
I can refer to this model with a containment reference, but i have a
problems :
i can refer to this model only one time (i would like to re-use model
many time in my main model).


Ed Merks wrote:
> RJ,
>
> This property will only allow you to contain within an EObject another
> EObject that itself is contained by a different resource. It has no
> impact on the fact that an EObject contained by another EObject will be
> removed from that EObject when it's contained by another EObject later.
>
>
> Judicael Ribault wrote:
>
>> ok thank you Ed,
>>
>> i try to set "Containment Proxies = true", and set "isResolveProxies =
>> true" on the Ereference attribute, but when i try, the object is
>> removed from his location ...
>> what is wrong ?
>>
>> regards, RJ
>>
>> Ed Merks wrote:
>>
>>> RJ,
>>>
>>> Maybe cross resource containment support is what you want. You need
>>> to enable "Containment Proxies" to support this, and in that case,
>>> any containment EReference for which isResolveProxies is true will
>>> allow the contained objects to also be contained by a separate
>>> resource. But this does not support sharing and an object that's
>>> contained by another object will still be removed from that other
>>> object because for an object referenced by a containment reference,
>>> it can still only have one eContainer. So if you really need to
>>> share the objects, you must use non-containment reference. I'm not
>>> sure what you point you at in terms of help. You basically have two
>>> choices, containment references and non-containment references. When
>>> you use the later, you'll need to make sure the referenced objects
>>> are at least contained somewhere, minimally as the root object of
>>> some resource. There's no much else to say...
>>>
>>>
>>> Judicael Ribault wrote:
>>>
>>>> Hi all,
>>>>
>>>> when i try to use a containment reference, model i refer are removed
>>>> from it's location to be copied under the containment reference.
>>>>
>>>> what i would like is to re-use some models. So i use the "Load
>>>> ressources..." menu, and make a containment reference to the new
>>>> loaded model.
>>>>
>>>> Maybe it's better to use a non-containment reference for what i
>>>> need, but i need ta have a new instance of the model i refer, not a
>>>> shared instance.
>>>>
>>>> can someone give me links to litterature or some help :)
>>>>
>>>> thanks you
Re: multiple containment reference [message #409903 is a reply to message #409901] Wed, 06 June 2007 11:14 Go to previous messageGo to next message
Eclipse UserFriend
ok sorry, i think i understand a bit more.

so, how peoples do when they have a lot of part of there models who are
the same like :

A
|-B
|-B'
|-B''

if they use non-containment, only one instance of B exists, they can't
use containment reference to other resource who define B like :

MainModels :
A
|-B
|-B'
|-B''

otherResource :
B

so, all the B,B' and B'' are defined and saved in the main models ?

sorry for my noob question about EMF

thank you Ed, you are very patient with me :)

regards, RJ

Judicael Ribault wrote:
> ok i see the Controll... menu in the popup.
>
> i'am able to build a model in a specific resource.
> I can refer to this model with a containment reference, but i have a
> problems :
> i can refer to this model only one time (i would like to re-use model
> many time in my main model).
>
>
> Ed Merks wrote:
>
>> RJ,
>>
>> This property will only allow you to contain within an EObject another
>> EObject that itself is contained by a different resource. It has no
>> impact on the fact that an EObject contained by another EObject will
>> be removed from that EObject when it's contained by another EObject
>> later.
>>
>>
>> Judicael Ribault wrote:
>>
>>> ok thank you Ed,
>>>
>>> i try to set "Containment Proxies = true", and set "isResolveProxies
>>> = true" on the Ereference attribute, but when i try, the object is
>>> removed from his location ...
>>> what is wrong ?
>>>
>>> regards, RJ
>>>
>>> Ed Merks wrote:
>>>
>>>> RJ,
>>>>
>>>> Maybe cross resource containment support is what you want. You need
>>>> to enable "Containment Proxies" to support this, and in that case,
>>>> any containment EReference for which isResolveProxies is true will
>>>> allow the contained objects to also be contained by a separate
>>>> resource. But this does not support sharing and an object that's
>>>> contained by another object will still be removed from that other
>>>> object because for an object referenced by a containment reference,
>>>> it can still only have one eContainer. So if you really need to
>>>> share the objects, you must use non-containment reference. I'm not
>>>> sure what you point you at in terms of help. You basically have two
>>>> choices, containment references and non-containment references.
>>>> When you use the later, you'll need to make sure the referenced
>>>> objects are at least contained somewhere, minimally as the root
>>>> object of some resource. There's no much else to say...
>>>>
>>>>
>>>> Judicael Ribault wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> when i try to use a containment reference, model i refer are
>>>>> removed from it's location to be copied under the containment
>>>>> reference.
>>>>>
>>>>> what i would like is to re-use some models. So i use the "Load
>>>>> ressources..." menu, and make a containment reference to the new
>>>>> loaded model.
>>>>>
>>>>> Maybe it's better to use a non-containment reference for what i
>>>>> need, but i need ta have a new instance of the model i refer, not a
>>>>> shared instance.
>>>>>
>>>>> can someone give me links to litterature or some help :)
>>>>>
>>>>> thanks you
Re: multiple containment reference [message #409907 is a reply to message #409903] Wed, 06 June 2007 11:50 Go to previous message
Eclipse UserFriend
RJ,

I'm not sure I follow the example. Normally you need to think about
where something will be contained so that it has a proper lifetime
that's related to the container's lifetime. It could just be in a
separate file too as a root. Then all the places that want to reuse it
will use non-containment references to refer to it.


Judicael Ribault wrote:
> ok sorry, i think i understand a bit more.
>
> so, how peoples do when they have a lot of part of there models who
> are the same like :
>
> A
> |-B
> |-B'
> |-B''
>
> if they use non-containment, only one instance of B exists, they can't
> use containment reference to other resource who define B like :
>
> MainModels :
> A
> |-B
> |-B'
> |-B''
>
> otherResource :
> B
>
> so, all the B,B' and B'' are defined and saved in the main models ?
>
> sorry for my noob question about EMF
>
> thank you Ed, you are very patient with me :)
>
> regards, RJ
>
> Judicael Ribault wrote:
>> ok i see the Controll... menu in the popup.
>>
>> i'am able to build a model in a specific resource.
>> I can refer to this model with a containment reference, but i have a
>> problems :
>> i can refer to this model only one time (i would like to re-use model
>> many time in my main model).
>>
>>
>> Ed Merks wrote:
>>
>>> RJ,
>>>
>>> This property will only allow you to contain within an EObject
>>> another EObject that itself is contained by a different resource.
>>> It has no impact on the fact that an EObject contained by another
>>> EObject will be removed from that EObject when it's contained by
>>> another EObject later.
>>>
>>>
>>> Judicael Ribault wrote:
>>>
>>>> ok thank you Ed,
>>>>
>>>> i try to set "Containment Proxies = true", and set
>>>> "isResolveProxies = true" on the Ereference attribute, but when i
>>>> try, the object is removed from his location ...
>>>> what is wrong ?
>>>>
>>>> regards, RJ
>>>>
>>>> Ed Merks wrote:
>>>>
>>>>> RJ,
>>>>>
>>>>> Maybe cross resource containment support is what you want. You
>>>>> need to enable "Containment Proxies" to support this, and in that
>>>>> case, any containment EReference for which isResolveProxies is
>>>>> true will allow the contained objects to also be contained by a
>>>>> separate resource. But this does not support sharing and an
>>>>> object that's contained by another object will still be removed
>>>>> from that other object because for an object referenced by a
>>>>> containment reference, it can still only have one eContainer. So
>>>>> if you really need to share the objects, you must use
>>>>> non-containment reference. I'm not sure what you point you at in
>>>>> terms of help. You basically have two choices, containment
>>>>> references and non-containment references. When you use the
>>>>> later, you'll need to make sure the referenced objects are at
>>>>> least contained somewhere, minimally as the root object of some
>>>>> resource. There's no much else to say...
>>>>>
>>>>>
>>>>> Judicael Ribault wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> when i try to use a containment reference, model i refer are
>>>>>> removed from it's location to be copied under the containment
>>>>>> reference.
>>>>>>
>>>>>> what i would like is to re-use some models. So i use the "Load
>>>>>> ressources..." menu, and make a containment reference to the new
>>>>>> loaded model.
>>>>>>
>>>>>> Maybe it's better to use a non-containment reference for what i
>>>>>> need, but i need ta have a new instance of the model i refer, not
>>>>>> a shared instance.
>>>>>>
>>>>>> can someone give me links to litterature or some help :)
>>>>>>
>>>>>> thanks you
Previous Topic:Why EMF can not support overrided attribute or reference code generation?
Next Topic:Beginner: Change names for tree elements?
Goto Forum:
  


Current Time: Wed Aug 06 14:12:44 EDT 2025

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

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

Back to the top