StarUML 5 and SVN

192 Views Asked by At

I'd like to track my UML diagrams with an SVN repository. I have a StartUML project, where I am drawing several diagrams that describe the requirements and architecture of my software project, and I'd like to manage and track changes for each diagram. I am wondering if there is a way to manage and version StartUML diagrams with SVN. I appreciate any help or suggestion on how to use a version control system like SVN with a StarUML project. Many thanks.

1

There are 1 best solutions below

3
Christophe On

Source code management systems like SVN and GIT are designed to manage and track changes of text files. They are much less efficient with binary files.

Fortunately, StartUML stores the model in a file using the .MDJ format which appears to be plain JSON text format. So as long as the source code management system scans the MDJ extension (if the file is stored in a tracked repository and if you commit it), it will monitor changes to the JSON file exactly as for the other source code files:

  • Changes are stored efficiently.
  • You can change between versions exactly in the way you'd navigate between versions for normal source file. You just need to close the model in StartUML and reload it again afterwards.
  • If you master the JSON format, you could do a git blame to see which line comes from which commit. You could even manage merge conflicts, however, only if you're fluent with JSON ;-)

Unfortunately, you have not very much control on the layout of the tracked file: small visual changes might lead to lots of changed lines. Moreover, unless you succeed in extracting each JSON part corresponding to a separate diagram in a separate file, the changes will be tracked at model level.

The tool seems to offer a fragment export/import function that allows to manually select model elements/diagrams to be individually saved in a separate file. However, it seems not appropriate for a systematic tracking of diagram changes, since it relies on an additional operation from a user, which can easily be forgotten. Unreliable versioning is in this regard worse than no versioning at all.

If you want to have things under tighter control, you could use the approach of "model as code", and use tools such as plantuml to write your diagrams as you'd do with code, grouping related items together and having separate (human readable) files for separate diagrams, and let the tool generate the diagrams based on text (you wouldn’t version the binary files corresponding to the rendering; only the text files).