Tim Scollick wrote:
Can you give details into your plans for this application? Any chance that the plan is to integrate this into an Eclipse plugin to build a UML class tool with roundtrip engineering?
The plan is to release it open source and let anyone do anything they want with it under the GPL license. :-)
It's written in Java, and it parses an .XMI model into Java classes named: Class, Operation, Attribute, Package, Interface, etc. The code generation then loops over all of the packages, then all of the classes, then all of the operations in the class, etc, and writes the data to a file.
So, this is the first step in round trip engineering. At least we have code generation. To go from code to class diagram would involve parsing a directory tree into the same Java classes (Class, Operation, etc), and then going from that to XMI. However, that may be a difficult road to go down (generating XMI isn't trivial).
Originally I was using NSUML (http://nsuml.sourceforge.net/) for the XMI handling. In the long run, this may be the better option for round trip engineering. ArgoUML uses this to convert its meta-model to XMI, and it can parse an XMI file into a meta model. I had a somewhat difficult time trying to get any data from the meta model (I admit I'm not too good with Java reflection), and found it was easier to write an XMI parser myself into a model that was easier to generate code from (in my eyes, anyway).
The Eclipse Modeling Framework is the "next generation" of XMI. XMI appears to be somewhat of an old specification, and all of the documentation I've found has said its matured into the Eclipse Modeling Framework. I could be wrong here, just going by what I remember reading a long time. I haven't done any research with that, but figuring out what the model is, how to get it, etc, is probably the way to go for Eclipse integration / round trip engineering (more so than using NSUML). For the time being though, this code gen should prove useful to other people as well - it's been pretty useful to me so far. Right now it generates AS2, but if you're sick enough you can write an AS1 code generater. :-) Actually, you can write a code generater for any language you want - it should be pretty simple once you see the source code (coming soon).
-d _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
