Dia - tools

This page is dedicated to some tools that might be useful if you're going to use dia for modeling software solutions in the Unified Modeling Language (UML). They might even be useful if you use another modeling tool but then you'd have to write an import-module.

dia_pl

dia_pl is the result of my first attempt(s) and draft on a importer for diagrams written in Prolog. Diagrams can be loaded and facts representing the model-data get asserted. So far so good, but I would - from my experience - not advise to use this if you want to do complex model-operations like class-unifications and so on. Although Prolog is somewhat naturally related to UML the missing type-declarations and usually stateful operation make work on larger projects fairly complicated and frustrating as errors relating to type-changes get usually spotted only at runtime. Therefor the approach evolved into the current state where basic facts representing object properties are used to describe the model instead of data-structures modeled by predicates. But then the need for doing a lot of operations on the database that involve checking for unifyability of object-properties and updating it according to the result made the prolog source look quite unelegant when compared to other scenarios where prolog simply rules. So I stopped working on it for now. The class-unification-operation has to be completely reworked and loading large diagrams is ridiciously slow (although I made some changes that speed it up a lot when compared to the first versions).
Source code is available here.
But note that this is at best a draft-version.

dia_imp

This is my second attempt, written in C++. Models can be loaded, classes can get unified and aggregations/compositions are interpreted by adding attributes if needed. After those operations the unified UML-classes can be transformed into C++-Metaclasses that represent the most necessary C++-language-elements. Those metaclasses are used to generate header-files and can be used as runtime-type-information(RTTI). The model-operations and the transformation from UML to the cpp-metaclasses as well as the metaclasses itself are more or less tailored for the needs of an interpretation of a particular model but should be easy to modify if not suitable for a given modeling-scenario.
Source code can be found here.

Notes

Future

When using dia_imp the transformations from UML to c++ are defined in c++, although it is possible to define them (at least largely) in UML. Being able to define them in UML would make the code-generator much more useable as it could then be tailored for use in other modeling scenarios by altering the meta-model(s). This is where the Prolog-attempt seems to be more fitting as model-variables and term-evaluation is easily implemented there. Nonetheless would such an approach require some serious work-effort.




Back to home
Copyright (C) 2012 Heiko Lewin