| Umbrello UML Modeller: A Diagramming Programme for the Unified Modelling Language Developed Using Bazaar Methods; BSc Honuors Dissertation, Final Report; University of Stirling, Department of Computing Science and Mathematics; April 2003 | ||
|---|---|---|
| Prev | Chapter 3. Developing Umbrello UML Modeller | Next |
The XML Metadata Interchange language is an XML language framework which can be used to store data from object based metamodels such as UML. It is a complex and rapidly developing language made more complex by the mix of versions of XMI with versions of UML and the lack of documentation available. In theory XMI allows for the sharing of UML models between modelling programmes, however XMI does not include visual information such as the positioning of widgets, nor does it allow for documentation. All programmes which use XMI must therefore extend it and in practice there is little portability of XMI files between programmes. Umbrello uses XMI as a basis for its file format.
I created an example file[umbrello-example-file] for Umbrello which contains all the objects, widgets and attributes possible. This is used as a test file to ensure compatibility in future versions. I submitted this file to the XMI mailing list[xmi-mailing-list] following a request for example implementation XMI files. The feedback from this confirmed that Umbrello's file format is essentially incompatible with other XMI implementations and some improvements were suggested. However it would be hard to implement these suggestions without breaking backwards compatibility of the file format and it would be hard to see the justification when other UML programmes produce XMI which is just as incompatible.
To make the file import code more compliant I added a check for the XMI metamodel being UML. Unfortunately this broke backwards compatibility of the format because an old alpha version of Umbrello did not save the metamodel to the file. Ensuring compatibility of file formats is a difficult task but it is especially difficult with openly developed software where pre-release versions are always available and people may come to rely on them.
By the time I had added new diagrams and objects to Umbrello, and refactored the association code the clipboard code had become out of date and contained many bugs. The clipboard is based on the original file format which used serialise() methods to write out the state of all classes to a data stream. These methods are hard to maintain (impossibly so if keeping backwards compatibility) and essentially duplicate the functionality of the more advanced XMI load and save code. I decided it would be easier and allow for simpler maintenance to re-write the clipboard to use XMI data rather than serialised data. This is more complex than the undo/redo code as it is not saving the whole file out at any time, the programme has to know which parts to save and requires custom loading code for each type of data which can be copied, however I was able to reuse some of the existing algorithms and methods. The result works well and should continue to work with minimal maintenance as more features are added to the programme.