Home » Modeling » EMF » Deleting a resource with containment reference to another resource
| |
Re: Deleting a resource with containment reference to another resource [message #503580 is a reply to message #503374] |
Mon, 14 December 2009 14:48 |
Stephen McCants Messages: 92 Registered: July 2009 |
Member |
|
|
Ed,
Thank you for your quick reply. I'm not sure I understand the purpose of "containment" when it is
across different resources. It seems to me, that when spanning across different resources,
containment and non-containment are the same thing, with perhaps the exception on an e-opposite
setting on the "container" variable. Am I missing something here?
Thanks again.
Sincerely,
Stephen McCants
Ed Merks wrote:
> Stephen,
>
> Delete on a resource acts only on the resource itself and the object
> contained by it. In this case I'd expect B to be unaffected other than
> that it's container reference to Object A will have become a proxy.
> You'll need to delete B separately.
>
> Stephen McCants wrote:
>> Hello All,
>> I have an expectations question about EMF. I have a model that
>> has Object A in it and Object A has a containment reference to Object
>> B. Now Object A is in Resource 1 and Object B is in Resource 2. It
>> was my understanding that if I delete Resource 1
>> (ObjectA.eResource().delete(null)) that Object B should also be
>> deleted. But this doesn't seem to be the case. After the delete, I'm
>> expecting
>>
>> ObjectB.eResource() == null
>>
>> But it doesn't equal null.
>> Are my expectations wrong or am I doing something wrong?
>> Thanks in advance!
>>
>> Sincerely,
>> Stephen McCants
|
|
|
Re: Deleting a resource with containment reference to another resource [message #503982 is a reply to message #503580] |
Wed, 16 December 2009 17:12 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Stephen,
Comments below.
Stephen McCants wrote:
> Ed,
> Thank you for your quick reply. I'm not sure I understand the
> purpose of "containment" when it is across different resources. It
> seems to me, that when spanning across different resources,
> containment and non-containment are the same thing, with perhaps the
> exception on an e-opposite setting on the "container" variable. Am I
> missing something here?
They're much the same thing yes.
> Thanks again.
>
> Sincerely,
> Stephen McCants
>
> Ed Merks wrote:
>> Stephen,
>>
>> Delete on a resource acts only on the resource itself and the object
>> contained by it. In this case I'd expect B to be unaffected other
>> than that it's container reference to Object A will have become a
>> proxy. You'll need to delete B separately.
>>
>> Stephen McCants wrote:
>>> Hello All,
>>> I have an expectations question about EMF. I have a model that
>>> has Object A in it and Object A has a containment reference to
>>> Object B. Now Object A is in Resource 1 and Object B is in Resource
>>> 2. It was my understanding that if I delete Resource 1
>>> (ObjectA.eResource().delete(null)) that Object B should also be
>>> deleted. But this doesn't seem to be the case. After the delete,
>>> I'm expecting
>>>
>>> ObjectB.eResource() == null
>>>
>>> But it doesn't equal null.
>>> Are my expectations wrong or am I doing something wrong?
>>> Thanks in advance!
>>>
>>> Sincerely,
>>> Stephen McCants
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Deleting a resource with containment reference to another resource [message #504418 is a reply to message #503982] |
Fri, 18 December 2009 18:55 |
Stephen McCants Messages: 92 Registered: July 2009 |
Member |
|
|
Hi Ed,
Okay. I find that confusing that containment and non-containment references across resources are
essentially the same thing. Wouldn't it be less confusing to forbid one or to alter one so they are
different? Of course, I have no idea what complications in the EMF code I'm asking for in order to
reduce possible confusion. Does it make any sense to try and differentiate these situations or at
least remove one of them?
Thanks for your time.
--Stephen
Ed Merks wrote:
> Stephen,
>
> Comments below.
>
> Stephen McCants wrote:
>> Ed,
>> Thank you for your quick reply. I'm not sure I understand the
>> purpose of "containment" when it is across different resources. It
>> seems to me, that when spanning across different resources,
>> containment and non-containment are the same thing, with perhaps the
>> exception on an e-opposite setting on the "container" variable. Am I
>> missing something here?
> They're much the same thing yes.
>> Thanks again.
>>
>> Sincerely,
>> Stephen McCants
>>
>> Ed Merks wrote:
>>> Stephen,
>>>
>>> Delete on a resource acts only on the resource itself and the object
>>> contained by it. In this case I'd expect B to be unaffected other
>>> than that it's container reference to Object A will have become a
>>> proxy. You'll need to delete B separately.
>>>
>>> Stephen McCants wrote:
>>>> Hello All,
>>>> I have an expectations question about EMF. I have a model that
>>>> has Object A in it and Object A has a containment reference to
>>>> Object B. Now Object A is in Resource 1 and Object B is in Resource
>>>> 2. It was my understanding that if I delete Resource 1
>>>> (ObjectA.eResource().delete(null)) that Object B should also be
>>>> deleted. But this doesn't seem to be the case. After the delete,
>>>> I'm expecting
>>>>
>>>> ObjectB.eResource() == null
>>>>
>>>> But it doesn't equal null.
>>>> Are my expectations wrong or am I doing something wrong?
>>>> Thanks in advance!
>>>>
>>>> Sincerely,
>>>> Stephen McCants
|
|
|
Re: Deleting a resource with containment reference to another resource [message #504442 is a reply to message #504418] |
Sat, 19 December 2009 10:57 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Stephen,
Comments below.
Stephen McCants wrote:
> Hi Ed,
> Okay. I find that confusing that containment and non-containment
> references across resources are essentially the same thing.
Originally Resource.contents and EObject.eContents were mutually
exclusive, i.e., Resource.contents was treated exactly like containment...
> Wouldn't it be less confusing to forbid one or to alter one so they
> are different?
But then along came people who complained that it must be possible to
decompose a large containment hierarchy across resource boundaries
otherwise they'd not be able to use EMF so we added support for
containment proxies and changed the behavior of containment references
for the case where EReference.resolveProxies is true. They didn't buy
the argument that they should just change such references to be
non-containment.
> Of course, I have no idea what complications in the EMF code I'm
> asking for in order to reduce possible confusion.
Of course you should realize you can never removed things from a
framework. You can only add things.
> Does it make any sense to try and differentiate these situations or at
> least remove one of them?
Only in an alternate universe where frameworks and APIs get smaller and
simpler over time. Probably in that universe time and entropy run backwards.
> Thanks for your time.
>
> --Stephen
>
> Ed Merks wrote:
>> Stephen,
>>
>> Comments below.
>>
>> Stephen McCants wrote:
>>> Ed,
>>> Thank you for your quick reply. I'm not sure I understand the
>>> purpose of "containment" when it is across different resources. It
>>> seems to me, that when spanning across different resources,
>>> containment and non-containment are the same thing, with perhaps the
>>> exception on an e-opposite setting on the "container" variable. Am
>>> I missing something here?
>> They're much the same thing yes.
>>> Thanks again.
>>>
>>> Sincerely,
>>> Stephen McCants
>>>
>>> Ed Merks wrote:
>>>> Stephen,
>>>>
>>>> Delete on a resource acts only on the resource itself and the
>>>> object contained by it. In this case I'd expect B to be unaffected
>>>> other than that it's container reference to Object A will have
>>>> become a proxy. You'll need to delete B separately.
>>>>
>>>> Stephen McCants wrote:
>>>>> Hello All,
>>>>> I have an expectations question about EMF. I have a model
>>>>> that has Object A in it and Object A has a containment reference
>>>>> to Object B. Now Object A is in Resource 1 and Object B is in
>>>>> Resource 2. It was my understanding that if I delete Resource 1
>>>>> (ObjectA.eResource().delete(null)) that Object B should also be
>>>>> deleted. But this doesn't seem to be the case. After the delete,
>>>>> I'm expecting
>>>>>
>>>>> ObjectB.eResource() == null
>>>>>
>>>>> But it doesn't equal null.
>>>>> Are my expectations wrong or am I doing something wrong?
>>>>> Thanks in advance!
>>>>>
>>>>> Sincerely,
>>>>> Stephen McCants
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Apr 25 12:24:29 GMT 2024
Powered by FUDForum. Page generated in 0.03811 seconds
|