4

I want to be able to create UML diagrams from source code - and I found UMMF - UML Meta-Model Framework. However, I could not find any tutorial to get me started on creating a diagram with two classes and a simple relationship between them.

Basically what I am trying to achieve for now, is to create a simple two tables diagram in a relation of 1..n:

two tables diagram to realize with perl UMMF

The XMI output for this diagram, is pretty verbose, because I created the diagram with Enterprise Architect - you can find this XMI file here (I could not embed the text here because is too big)

I want to use UMMF because it creates XMI files, based on perl object hierarchies that are related to OMG UML standards and those files can be imported in any modelling tool that implement those standard.

So the question is, how can I create this diagram using UMMF? - it is not necessary to be that complex.

I need the diagram to have:

  • two tables
  • at least one table to have:
    • one field as primary key
    • one indexed field
    • one regular field (not indexed)
  • a relation between the two tables

Also if you know of the existence of any good Perl UMMF tutorials, please show us their links

Tudor Constantin
  • 26,330
  • 7
  • 49
  • 72

2 Answers2

1

UML::Class::Simple can create XMI files from source code. That may be a good starting point.

Cosmicnet
  • 389
  • 4
  • 14
1

You can use UMMF to programmatically create UML models from Perl and export them to XMI. However, UMMF only supports UML 1.5 -- a standard graphical diagram meta-model didn't exist until UML 2.0 AFAIK.

You might want to look at Graphvis: http://www.graphviz.org/

I've done some basic stuff to create UML-like diagrams with it. It has some basic support for record-oriented diagrams.

Someone could probably write a XMI->Graphvis transformer using UMMF. :)

BTW: I'm the author of UMMF.

Kurt Stephens
  • 61
  • 1
  • 2
  • Hi kurt, welcome to stackoverflow and thanks for your response - I was interested in being able to generate pure XMI files based on Perl code - the visualization would have been done by Enterprise Architect, Umbrello, or other software dedicated to UML modelling - unfortunately since then I got extremely busy and distracted by many other things and I couldn't study your framework anymore - I hope I'll got to have some time soon to start again – Tudor Constantin Jan 11 '12 at 07:43
  • UMMF assumes knowledge of the UML metamodel, in fact all the Perl code is generated from a textual description of UML written in UML. The key UML Element objects you need to connect are Model, Class, Association and Attribute. http://ummf.svn.sourceforge.net/viewvc/ummf/ummf/release/ummf-1.03/test/test2.pl?revision=1070&view=markup may be helpful. – Kurt Stephens Jan 12 '12 at 00:46