tags:

views:

54

answers:

4

I'm designing a software component which will get instructions from other components on how the UML diagram should look like, and then will produce this UML diagram in different presentation ways (in SVG, GIF, etc.), for example (in Java):

DiagramDesigner designer = new DiagramDesigner();
designer.setStyle('Use Cases')
designer.addActor('User');
designer.addUseCase('Print Document');
// etc.
String svg = designer.getSvg();

I don't want to re-invent the wheel and want to use some industry-standard language/interface for interconnection between my DiagramDesigner and other components. I'm looking for an interface similar to DOM, but for UML, not for XML.

Can anyone help? Thanks in advance.

ps. Besides the example above I would like to make my diagrams inter-operable and transferrable between servers, e.g.:

// first server
String script = designer.getScript();
// second server
DiagramDesigner desiger2 = DiagramDesigner.import(script);
A: 

Probably only loosely related but anyhow: PlantUML. It is open source, built in Java and likely contains already parts of what you want to do.

Bernd
Bernd, thanks for your comment, I reviewed the PlantUML tool and it looks like a great instrument, but is not exactly what I'm looking for. Thanks anyway.
Vincenzo
+2  A: 

So if I understand you right, you are looking for a way to work with UML on the metamodel level. You should look at the MOF standard and its implementation the EMF (Eclipse Modeling Framework), which is used by almost all Eclipse based UML tools and this framework is used by many other modeling projects, it even somewhat influenced the standardization of MOF (resulting in SMOF and EMOF split) and therefore I would declare it industry standard.

Gabriel Ščerbák
Gabriel, thanks for your comment, it's very helpful. One thing is still important for me — whether EMF enables anything except class diagrams. I'm talking about state charts, activity diagrams, etc. — the dynamic part of UML? I didn't find that in EMF documentation. Looks like EMF is only for static models.
Vincenzo
@Vincenzo this depends on what you intend to do. Ecore (EMF diagrams) are used to create metamodels which are represented by simplified class models, that is what you are referring to I guess. However the whole UML is modeled using this and you can create UML models in this way. The problem is with diagrams (note ther is a difference between model and diagram), for some time there was no standard way of storing them, nowadays there is DI2, however I don't think it is much supported.
Gabriel Ščerbák
Thanks again, I will continue going this way..
Vincenzo
@Vincenzo I hope it helped:)
Gabriel Ščerbák
A: 

At least for the syntax part, you could get some inspiration from the large set of textual UML tools (theses tools allow designers to textually specify the model and then they automatically show the model graphically using the standard UML notation).

At least of such tools here: http://modeling-languages.com/content/uml-tools#textual

Jordi Cabot
A: 

You can inspire from these scripts to generate any output you want: http://askuml.com/

Currently examples are given in yUML because they're nice but could be anything.

Rebol Tutorial