Re: code generation with UML/XMI and o:xml ?

Martin Klang <[email protected]> Tue, 19 Oct 2004 17:07:11 +0100
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
John,

I've attached updated stylesheets that produce o:XML stubs from XMI 1.0 
(ArgoUML) and XMI 1.2 (Poseidon) respectively.
There's also a stylesheet for reverse-engineering the model - it takes 
an o:XML source file and produces an XMI model. So far only in XMI 1.2 
format, but should be easy enough to port to 1.0.

Together the xslt's provide simple UML round-trip engineering for o:XML.
Admittedly the stylesheets are very simple and don't handle all aspects 
of a model - so far only Package, Class, Generalization, Operation and 
Attribute constructs are mapped.

In ArgoUML the save file (model.zargo) is a Zip archive containing the 
XMI model description. Unzip the file and run the 1.0 xsl to generate 
o:XML source code.
In Poseidon, you can export a model as XMI or grab it from the save 
file (model.zuml) as with ArgoUML. Main difference is that the Posedion 
XMI format is v1.2 and includes diagram information as well as model 
data.

For reverse-engineering, generate an XMI file from o:XML sources with 
the oml-to-xmi stylesheet, and simply open the resulting XMI file in 
Poseidon. You won't see a diagram, but the model is there. If you 
right-click on a package you can then choose 'Create class diagram from 
package' which will add all types to a new class diagram. Or create the 
diagram you want, and then add the classes.

When I've a bit of time I'll publish the stylesheets on the website, 
together with some sample models (the core o:XML types and o:Lib comes 
to mind).

I'd be very interested to hear how you get on with this, and from 
anyone using different modelling software. XMI is becoming a commonly 
accepted format for UML, albeit in many different dialects. It would be 
nice to test the stylesheets and some generated models against a few 
different products.

regards,

/m

On 16 Oct 2004, at 23:17, John Cobo wrote:

> Martin,
>  
> Thank you for the prompt response.  My interest comes from two 
> directions.
> 1. My job includes a bit of UML to specify systems in a big IT 
> department.  In big organisations there is often a chasm between 
> analysts and developers.  UML is meant to give them a common language, 
> but I have always felt that UML diagrams would be 100 times more 
> useful if one could generate something from them.  Even a basic 
> generated prototype would help ensure the UML is complete, accurate, 
> and reflects what the analyst and business are talking about.  It 
> seems that o:xml would be a great tool for such things from what I 
> have read (and you have written) about it.  I also have a personal 
> system up my sleeve I would like to develop, but am too lazy to code 
> anything more than once.
>  
> 2. My second reason for interest is that I have done a bit of work 
> with MDA tools.  While they are useful, I think they would be MUCH 
> more useful if they allowed for model to model transformations.  There 
> is talk of this as a theory, but I have yet to see it.  Wouldn't it be 
> great if you could drop in one class with stereotype <user 
> authentication> (for example).  Save the model to xmi, run a program 
> that would expand that one class into several following a pattern.  
> These would then be in the updated/generated XMI model ready for 
> configuration to the specific business problem at hand.  Eventual code 
> generation to JAVA or whatever could be a lot simpler if most of the 
> work was done in model to model generation(s) ant therefore able to be 
> edited in the model itself rather than in transformations to code 
> which is therefore not in the model for next time.
>  
>  
> The short answer is, yes, I have XMI, I generally use the latest 
> community version of Poseidon.  I'm not sure which XMI version that 
> produces and I am at the wrong PC now to check.
>  
> If you don't mind sharing the XSLT you mentioned I would enjoy (??) 
> having a look.  I am not sure I have fully got my head around o:xml 
> yet, but did manage basic XSLT.
>  
> Thanks,
>  
> John Cobo
>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

_______________________________________________
o-xml mailing list
o-xml-zRfLyl9bSvv/[email protected]
http://lists.pingdynasty.com/mailman/listinfo/o-xml
oml-to-xmi1_2.xsl (application/octet-stream, 3.6 KB) - not displayed
xmi1_0-to-oml.xsl (application/octet-stream, 4.6 KB) - not displayed
xmi1_2-to-oml.xsl (application/octet-stream, 3.6 KB) - not displayed