Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » getWrapper what is it ?
getWrapper what is it ? [message #429129] Thu, 09 April 2009 12:04 Go to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hi !
i'm currently debugging some code and i've founded lines using
getWrapper() method from AdapterFactoryEditingDomain.
i debug for performances issues and i see this method is called some
times and at each call this method browse all the model.
So what is this method ? :/




Re: getWrapper what is it ? [message #429134 is a reply to message #429129] Thu, 09 April 2009 12:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Tristan,

When models use non-containment references as children, those children
are wrapped because such objects might occur more than once in a tree.
Also, a feature map entry doesn't know which feature map contains it, so
in that case too, a wrapper that knows the actual parent is needed. So
when an object needs to be selected in the view, it's necessary to
determine if there's actually only a wrapper for it rather than just the
"bare" object being there. Of course if you have no wrappers, and the
performance of the check is excessive in your application, you could
just specialize the adapter factory editing domain to skip that check.


Tristan FAURE wrote:
> Hi !
> i'm currently debugging some code and i've founded lines using
> getWrapper() method from AdapterFactoryEditingDomain.
> i debug for performances issues and i see this method is called some
> times and at each call this method browse all the model.
> So what is this method ? :/


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: getWrapper what is it ? [message #429135 is a reply to message #429134] Thu, 09 April 2009 12:30 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Yes but i'm not certain we never use it
i thought about overrding this mechanism but is it possible to check if
the object has to be wrapped ?

Ed Merks a écrit :
> Tristan,
>
> When models use non-containment references as children, those children
> are wrapped because such objects might occur more than once in a
> tree. Also, a feature map entry doesn't know which feature map
> contains it, so in that case too, a wrapper that knows the actual
> parent is needed. So when an object needs to be selected in the view,
> it's necessary to determine if there's actually only a wrapper for it
> rather than just the "bare" object being there. Of course if you have
> no wrappers, and the performance of the check is excessive in your
> application, you could just specialize the adapter factory editing
> domain to skip that check.
>
>
> Tristan FAURE wrote:
>> Hi !
>> i'm currently debugging some code and i've founded lines using
>> getWrapper() method from AdapterFactoryEditingDomain.
>> i debug for performances issues and i see this method is called some
>> times and at each call this method browse all the model.
>> So what is this method ? :/




Re: getWrapper what is it ? [message #429136 is a reply to message #429135] Thu, 09 April 2009 12:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Tristan,

No, there's no way to know given the object itself if there might be a
wrapper for it. If you've doing nothing to enable non-containment
children (GenFeature's Children property) and you don't use feature
maps, you won't be using wrappers.


Tristan FAURE wrote:
> Yes but i'm not certain we never use it
> i thought about overrding this mechanism but is it possible to check
> if the object has to be wrapped ?
>
> Ed Merks a écrit :
>> Tristan,
>>
>> When models use non-containment references as children, those
>> children are wrapped because such objects might occur more than once
>> in a tree. Also, a feature map entry doesn't know which feature map
>> contains it, so in that case too, a wrapper that knows the actual
>> parent is needed. So when an object needs to be selected in the
>> view, it's necessary to determine if there's actually only a wrapper
>> for it rather than just the "bare" object being there. Of course if
>> you have no wrappers, and the performance of the check is excessive
>> in your application, you could just specialize the adapter factory
>> editing domain to skip that check.
>>
>>
>> Tristan FAURE wrote:
>>> Hi !
>>> i'm currently debugging some code and i've founded lines using
>>> getWrapper() method from AdapterFactoryEditingDomain.
>>> i debug for performances issues and i see this method is called some
>>> times and at each call this method browse all the model.
>>> So what is this method ? :/


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: getWrapper what is it ? [message #429138 is a reply to message #429136] Thu, 09 April 2009 13:04 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
ok
thank you for your answers !

Ed Merks a écrit :
> Tristan,
>
> No, there's no way to know given the object itself if there might be a
> wrapper for it. If you've doing nothing to enable non-containment
> children (GenFeature's Children property) and you don't use feature
> maps, you won't be using wrappers.
>
>
> Tristan FAURE wrote:
>> Yes but i'm not certain we never use it
>> i thought about overrding this mechanism but is it possible to check
>> if the object has to be wrapped ?
>>
>> Ed Merks a écrit :
>>> Tristan,
>>>
>>> When models use non-containment references as children, those
>>> children are wrapped because such objects might occur more than once
>>> in a tree. Also, a feature map entry doesn't know which feature map
>>> contains it, so in that case too, a wrapper that knows the actual
>>> parent is needed. So when an object needs to be selected in the
>>> view, it's necessary to determine if there's actually only a wrapper
>>> for it rather than just the "bare" object being there. Of course if
>>> you have no wrappers, and the performance of the check is excessive
>>> in your application, you could just specialize the adapter factory
>>> editing domain to skip that check.
>>>
>>>
>>> Tristan FAURE wrote:
>>>> Hi !
>>>> i'm currently debugging some code and i've founded lines using
>>>> getWrapper() method from AdapterFactoryEditingDomain.
>>>> i debug for performances issues and i see this method is called
>>>> some times and at each call this method browse all the model.
>>>> So what is this method ? :/




Previous Topic:Ecore2Java ant task
Next Topic:Wrong classifierID of EDataType for user-derived simple type
Goto Forum:
  


Current Time: Thu Mar 28 23:11:17 GMT 2024

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

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

Back to the top