Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (no subject)
(no subject) [message #686874] Thu, 12 May 2011 04:50
John Smith is currently offline John SmithFriend
Messages: 137
Registered: July 2009
Senior Member
When a XMI file is loaded, a parsed reference from an element A to an
element B may be recorded as a so called "forward reference" if B is not
yet parsed (since located further down the file). However if the
reference has an eOpposite, its not always required to record that
forward reference, since the reference will be set when the opposite
reference is parsed (together with element B). The local Java variable
"mustAdd" in XMLHandler determines this necessity whether a forward
reference must be recorded or not.

So I do not understand the statement

mustAdd = eOpposite.isTransient() || eReference.isMany();

Of course, if the eOpposite reference is transient, then the opposite
reference will never be parsed (together with element B) and a forward
reference must be added. However why must a forward reference be added
if its a many-valued reference? My only idea why this could be wanted is
to preserve the order of the references. But then this statement would
be more senseful:

mustAdd = eOpposite.isTransient() || eReference.isMany() &&
eReference.isOrdered();

This statement would mean, that for metamodels using bidirectional
references where order of references is not important no forward
references would need to be recorded at all.

Since reference are by default ordered, the new implementation would
affect few projects, however would speed up for projects using the
ordered=false feature. My goal is to write a CDO importer for XMI files
of several gigs size, flushing already read elements at defined time
intervals to the CDO database since CLEAN elements can be CDO-garbage
collected (it doesnt matter if they get DIRTY later, when the opposite
reference is read). And I fear the forward reference list could get very
large.
Previous Topic:Best practice: Direct model code, editing domain, command stack
Next Topic:How to customize name of Java enum
Goto Forum:
  


Current Time: Fri Apr 26 02:53:48 GMT 2024

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

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

Back to the top