hide all comments


XMI, MOF and MetaEdit+

May 03, 2005 17:28:06 +0300 (EEST)

Just got some nice feedback on MetaEdit+ from someone trying it at SAP. He also asked about importing XMI into MetaEdit+. It's hard to give a single correct answer to that, because the variety of XMI formats is considerable.

The OMG has XMI versions 1.0, 1.1, 1.2 and 2.0, with 2.1 under development. Looking on Google, I note that there are 865 XMI files on the web using 1.0, 78 for 1.1, 64 for 1.2, and 34 for 2.0 (released in 2003). That gives some indication of the adoption of XMI as a format, and tallies with my own impression. Everybody was interested when it first came out, but most who actually tried to use it found it lacking. One can always hope the situation improves with newer versions...

XMI suffers from the same problems as MOF, e.g. no support for n-ary relationships and too much dependence on UML. For those reasons it was not sufficiently powerful or flexible for use as the XML import/export format for MetaEdit+. Instead, we used GXL from Andreas Winter and Andy Schürr (among others). GXL is significantly better than XMI in both architecture and schema details, and is supported by an impressive array of tools. As MetaEdit+ 4.0 added the concept of Port, which is not present in GXL, we now use our own extension of GXL.

At the end of the day, though, all XMI and GXL versions are simply XML documents containing sufficient information describing models. As such, there are two ways to get data from XMI into MetaEdit+. One way is by transforming the XMI file into the MetaEdit+ GXL format, e.g. using XSLT. The other way is to have a program read the XMI file and make calls into MetaEdit+ to create corresponding objects etc. The MetaEdit+ API uses SOAP as its protocol, and so can be easily called from pretty much any client. [Some other examples of API and XML import/export use can be found here - with pretty animated GIFs :-).]

In either case, I'd imagine this would be a one-shot transformation: trying to maintain the same models or metamodels in two tools is almost always a bad idea. As someone wise has said "One tool is useful; two tools are a nightmare".