Re: [mdr-users] createExtent(String, RefObject, RefPackage[])
Martin Matula <[email protected]> Mon, 05 Sep 2005 17:00:29 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.user |
|---|---|
| Message-ID | <[email protected]> |
Pieter Van Gorp wrote: >From the description of the method one would expect that as soon as >the array includes existing extents they will be shared. >http://www.netbeans.org/download/dev/javadoc/MdrAPIs/org/netbeans/api/mdr/MDRepository.html#createExtent(java.lang.String,%20javax.jmi.reflect.RefObject,%20javax.jmi.reflect.RefPackage[]) >This is not the case. > > Well, I am even more confused. In the last paragraph of your e-mail you say it is the case, in this paragraph you say this is not the case. Why do you think this is not the case? As far as I remember, your test that you sent me confirmed that it is the case. >Originally, I expected that I could even load a standalone extent and >then pass it to the clustering extent. As you stated, MDR could >support this but does not do this: >http://mdr.netbeans.org/servlets/ReadMsg?list=users&msgNo=3259 > > You can load a standalone extent and pass it to the clustering extent. What the XMI reader does not do is it does not recognize that an object is already loaded - i.e. if you load the same model 1000x times, it will create 1000 same instances of the same model elements. That is not related to the clustering at all. You can make it work smarter by writing your own reference resolver. >What I did afterwards was using extents loaded with the clustering >metamodel only (instead of using instances of the standalone version >of the clustered metamodels). However, I passed such an extent twice >as member of two different arrays. MDR did not check whether the >array members were already clustered. I would expect this to happen, >according to the Javadoc description. > > My understanding of this is that an extent got clustered by two different extents (i.e. C will be shared by both A and B). If so, this is perfectly OK. Where in javadoc did you see that this should not be the case (i.e. that you cannot cluster an extent that was already clustered by some other extent)? Martin