Re: [mdr-users] createExtent(String, RefObject, RefPackage[])
Martin Matula <[email protected]> Fri, 05 Aug 2005 13:17:49 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.user |
|---|---|
| Message-ID | <[email protected]> |
Pieter Van Gorp wrote: >Hi all, >I'm looking for some information on the method to create an extent >that clusters an already existing extent: >(i.e. 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[]) >) > >A short explanation of the array argument or some example code should do it. > >I passed a one-size array containing a UML extent to it but the >clustered UML extent of my tracing extent (see >http://www.fots.ua.ac.be/motmot/docs/traceability-p3.php) remains >empty. > That's weird - it should work correctly. I.e. if package A clusters package B and you create instance of B, then if you pass this instance B into the createExtent() method to create extend A, the instance of B should be reused. >I already found it a bit weird that I didn't have to specify >in which package of the tracing extent the existing UML extent should >be loaded. Sure, in my case there's only one clustered UML extent but >problems should arise as soon as there would be more... therefore I >must be missing something... > > This is not weird. According to MOF semantics, if A and B both cluster C, then only one instance of C is created and shared by both A and B. Similarly, if an instance of C already exists and you are creating instance of A and B (or D which owns A and B), then the instance of C is reused for both. Martin