RE: [mdr-users] Programmatic model generation via MDR

"Tom Morris" <[email protected]> Wed, 3 Jan 2007 15:07:42 -0500
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <004b01c72f72$d7980570$6401a8c0@micronxp>
> My team wants to express its model in our own text (YAML)=20
> format, rather than via a WYSIWYG UML tool, and be able to=20
> use it in Andromda.  To do that, we need to be able to=20
> programmagically build an XMI representation of our model=20
> after parsing our YAML files.  Does MDR provide an API for=20
> defining a model (including classes, associations,=20
> attributes, operations, etc.) from scratch programmatically,=20
> and then exporting it to XMI?

Sure.  That's what ArgoUML (nasty WYSIWYG UML tool) uses to generate XMI
files that can be fed to AndroMDA.

> I've been unable to find documentation which details how this=20
> might be done.  Any pointers would be greatly appreciated!

Well, like all things UML, there's really not a lot of  "getting =
started"
documentation for writing tools (as opposed to just using UML).

The key thing that you're probably missing is that MDR is an =
implementation
of JMI which is just a thin veneer for working with MOF which is in the =
M3
layer, while you really want to be working with UML 1.4 which is at the =
M2
layer.  You'll need to load the UML 1.4 metamodel with MDR and then work
with those UML elements.  In practice this means that you'll be =
depending
heavily on the UML 1.4 spec, but only using the JMI & MDR Javadoc a =
little
bit.

If you want an example of software that does this, you can look at the
ArgoUML subsystem that encapsulates all the UML 1.4 / MOF / JMI / MDR =
stuff
here =
http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/.
The API was defined as a fa=E7ade to wrap our previous UML =
implementation
library (NSUML), so it's not what you'd design if you were starting from
scratch, but it works.

BTW, your post came through with an ad for a commercial mailing list
archive.  You can access the list archives directly at
http://mdr.netbeans.org/servlets/ProjectMailingListList

Tom