|Re: Manual Notificatios [message #423397 is a reply to message #423394]
||Mon, 29 September 2008 20:18
| Ed Merks
Registered: July 2009
Alex Boyko wrote:
> I'd like to model an object (a property container object) with a list
> of elements where each element in the list is Property EDataType).
> Also, I'd like this object to have a small memory footprint.
> Option 1. Create an object and declare properties as a "many"
> Attribute of type Property EDataType. This will introduce an EList.
> Option 2. Create EDataType for Properties that will contain a
> Property array and work with it manually through putProperty() and
> getProperty() operations declared on modeled property container
> object. eNotify(..) will be cellaed manually where old and new object
> in the notification event are old and new Property (not Properties).
> In this case I'd have to hack a bit to get the undo working, i.e. in
> eSet(...) for the properties attribute check the instance of the
> passed object. If it's Property then call putProperty otherwise normal
> I wonder if option 2 will save anything memory-wise and whether there
> are more problems with it than just the undo. Perhaps, it would be
> better just to extend the EList or the BasicEList (whatever is
> generated from option 1) and play around with it to get the desired
> small size of the object if possible?
EMF's lists, like java.util.ArrayList have very little footprint. Are
you trying to optimize something that's a known issue or just planning
ahead for anticipated issues. I.e., are you expecting a huge number of
such lists? Even if you are, the overhead of the object that owns the
list will dwarf the overhead of the list. You might fiddle with the
grow method if the number of unused array slots is an issue...
> Thanks in advance.
Powered by FUDForum
. Page generated in 0.01489 seconds