Re: [mdr-users] RE : [mdr-users] Restoring model using cluetered package

Martin Matula <[email protected]> Sun, 13 Nov 2005 20:02:43 +0100
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hm. Solving this problem can be quite tricky. You are right you cannot 
rely on MOF IDs. You should probably refer to elements using their fully 
qualified names (given they are unique). Or you could have a separate 
"internal properties" extent that would cluster your other extents and 
could contain some additional attributes (like a special tagged values 
containing your proprietary IDs) that could be attached to the elements 
in the clustered packages and you could deserialize your elements based 
on those (the attributes would contain xmi.ids for a given element). You 
could add an additional index to the value of the "attribute" (or 
whatever you will model to represent the internal properties) to speed 
up the lookups.
Martin

Olivier RICHAUD wrote:
> OK what's happening:
> 
> 1. A model is defined in UML, exported as XMI/UML, and converted to MOF,
> much like UML2MOF
> 
> 2. This model is enriched. For example, non abstract classes inherit
> from a class which has previously been loaded in a package. Thus, in
> order to use those previouly defined packages, we add all needed imports
> clauses and we create the new extent by passing references to those
> clustered packages (array of RefPackage as required).
> 
> 3. Then we decide to export the model in XMI. Thus, in our XMI there
> classes that inherits from classe defined in the clustered package. And
> we only have an import clause for the imported package, but this clause
> only refers to the MOF ID of the import packages
> 
> 4. Now, I decide to clean up MDR. And I want to restart from XMI/MOF
> file previsouly exported. As I told you, there is only an import clause
> and some of my classes refer to a class defined (by ad xmi.idref
> attribute) in the imported package. Our system, at start up, recreate
> all these needed imported packages by reading a bunch of MOF/XMI files.
> Of course, we can't restore these package with the same MOF Id, as it is
> of MDR responsibility to assign MOF ID.
> 
> What's most surprising is MDR behaviour, and to explain this I have
> attached a model. You can pay attention to class Definition and
> DataDefinition: they are both defined in the model and not part of an
> imported package. Definition inherits from DataDefinition but also of a
> class from this imported package (an import clause exists). Definition
> an d DataDefinition are correctly restored using XmiReader and MDR does
> not complain. But although it could restore inheritancy relationship
> between DataDefinition and Definition, it doesn't.
> 
> I hope I'm clear enough.
> 
> Regards.
> 
> Olivier
> 
> 
> 
> -----Message d'origine-----
> De : Martin Matula [mailto:[email protected]] 
> Envoyé : jeudi 10 novembre 2005 16:54
> À : [email protected]
> Objet : Re: [mdr-users] Restoring model using cluetered package
> 
> 
> I don't understand. What do you mean by "restoring" the model? Martin
> 
> Olivier RICHAUD wrote:
> 
>>H i all,
>> 
>>I need to restore a model where some classes inherits from classes 
>>that
>>where brought by a clusred Package:
>> 
>>A in clustered package CP <|---- B in package P
>> 
>>My XMI file has an import clause for the clustered package.
>> 
>>Any idea, advice?
>> 
>>Regards.
>> 
>>Olivier.
>> 
>> 
>>