Today we have a guest post by Steffen Mazanek where he introduces the DiaGen and DiaMeta tools. Enjoy!

DiaGen and DiaMeta both are meta-tools (see figure below) for the generation of diagram editors. The project leader is Mark Minas from Universität der Bundeswehr München.

The generated editors use hypergraphs as a diagram model. Hypergraphs are a generalization of graphs where edges can visit an
arbitrary number of nodes. The most distinguishing feature of DiaGen/DiaMeta editors is that diagrams can be drawn in so-called
free-hand mode, i.e. incorrect diagrams are perfectly admitted and just reported to the user. This is very practical in the context
of sketching and indeed there is a DiaGen add-on, DSketch, for the generation of sketch editors. But also in conventional WIMP-based
diagram editors free-hand editing improves the flexibility and creativity of the modeler. But DiaGen/DiaMeta also provide support for
the definition of editing operations, which are a kind of macro, in order to simplify frequent editing tasks. Below a screenshot of a
DiaGen editor for business process models is given.

DiaGen and DiaMeta basically share a common code base. The major difference between them is that DiaGen specifications are based on
hypergraph grammars whereas DiaMeta relies on metamodels (EMF or MOF) for the definition of the language syntax. So, the syntax check is performed by a hypergraph parser in DiaGen, whereas in DiaMeta a model checker is employed. Today, many users prefer metamodels to graph grammars. Still DiaGen might be more appropriate for certain tasks, because it allows for a convenient constraint-based layout specification along the grammar rules. Also, DiaGen editors support syntax-based user assistance which is enabled by some very nice properties of hypergraph grammars.

The structure of a DiaGen/DiaMeta specification is determined by the way how diagrams are processed (see figure above). It consists of the
following parts:

  • At first, the appearance and the handles of diagram components have to be defined, i.e. their look and feel. Also the attachment
    areas can be defined in this section. Each diagram component will be represented by a component hyperedge in the diagram’s hypergraph model. The attachment areas are represented by the nodes incident to a component hyperedge.
  • Next, the relevant spatial relations between diagram components need to be defined. For instance, the head of a sequence arrow can
    touch the border of an activity. Spatial relations are represented as special relation edges in the diagram’s hypergraph model, see the
    example hypergraph model given below. A graphical scanner (called modeler) searches for such relations in the diagram.
  • Thereafter, rules for lexical analysis have to be defined as a kind of hypergraph transformation rules. That way, the hypergraph
    model can be simplified to speed up the analysis afterwards (similar to string processing where lexical analysis is a common
    technique).
  • Next, a hypergraph grammar (DiaGen) or a metamodel (DiaMeta) need to be defined for syntax analysis. This will be used by the parser or model checker, respectively.
  • Optional: A layouter can be defined, e.g. using geometric constraints and an appropriate solver, or by using one of the
    pre-defined layouters.
  • Optional: Editing operations can be defined using hypergraph transformation rules.
  • Optional: Rules for the creation of a semantic representation can be defined, e.g. for the derivation of BPEL from BPMN.

Both DiaGen and DiaMeta are research tools, but they are actively maintained. If you want to give them a try or have any further
questions, you should contact Mark Minas to get the most recent version. A good impression of DiaGen gives my solution to the GraBaTs 2009 case study of a BPMN2BPEL transformation, which is available as a SHARE virtual machine.

Further Reading:

  • Concepts and realization of a diagram editor generator based on hypergraph transformation. Mark Minas, 2002, Science of Computer
    Programming, 44(2):157-180. (describes DiaGen)
  • Generating meta-model-based freehand editors. Mark Minas, 2006, Proc. of 3rd International Workshop on Graph Based Tools (GraBaTs’06). (describes DiaMeta)
  • Business Process Models as a Showcase for Syntax-Based Assistance in Diagram Editors. Steffen Mazanek and Mark Minas, 2009, Proc. of the ACM/IEEE 12th International Conference MODELS 2009. (describes syntax-based user assistance by means of an example language)

 

Want to build better software faster?

Want to build better software faster?

Read about the latest trends on software modeling and low-code development

You have Successfully Subscribed!

Pin It on Pinterest

Share This