Visual OCL

TU-Berlin | Faculty IV | Institute ISTI | Research group TFS

A converter to OCL for the Eclipse VOCL-Editor

small logo
section: < previous | next >
| |
chapter: << previous | next >>

Details of the implementation

The following part concentrates on the editor of group 1 and its converter as the author took part in the project for this group.

At first our converter tries to find a classifier role to start navigations from, i.e. one whose name attribute is “self” or equals a given start classifier in the constraint’s context. At this point some reasonable conditions are proved by the converter like that there has to be exactly one eligible classifier role to start from and that the class name of the start role has to match the one of the context.

By the way, already the editors can be endowed to check similar conditions when a diagram is being drawn as some groups did. But our group decided to let the user even draw unconvertible diagrams for example with ambiguous start classifier roles. Sometimes one might want to draw senseless examples, maybe for explanatory purposes.

After this, starting at the located start classifier role the diagram is traversed with breadth first search. The converter assembles parts of OCL meta-model instances like equations or navigations to attributes at the time they are found.

In the end these expressions are conjugated with an appropriate object of the OCL meta-model package which gets embedded in a constraint object.

Calling convert2OclString() finally yields the textual expression of this OCL constraint as described in the former section.


  section: < previous | next >
| |
chapter: << previous | next >>
©2005 TFS