Overview of the Viewpoint Meta-Models

  1. Overview of the Viewpoint Meta-Models
    1. Introduction
    2. Viewpoint Specification Meta-Models
    3. Representation Meta-Models

Introduction

Viewpoint uses EMF models to store both Viewpoint Specification Models (the *.odesign files) and representation data (the *.aird files). If you need to extend the Viewpoint platform in Java, sooner or later you will have to deal with elements from these meta-models, so this document gives a very brief overview of which meta-models are used, where they are defined and how they are organized.

Viewpoint Specification Meta-Models

The structure of the VSMs is defined by several meta-models. The fr.obeo.dsl.viewpoint plug-in contains the http://www.obeo.fr/dsl/viewpoint/description/1.1.0 Ecore package and its sub-packages, which defines both the general structure of a VSM and the diagram descriptions (diagrams are defined in the core plug-in for historical reasons):

The other dialects define their own extensions to these packages, in their own plug-ins. They follow the same structure:

Representation Meta-Models

The meta-models described above correspond to the elements which are found inside the *.odesign files. The representation files ( *.aird) are also stored as models. A representation can be though of as a serialized version of a Viewpoint session. It includes references to the semantic models represented in the session, and the model for each actual representation (diagram, table or tree). These representation models are organized into groups corresponding to which viewpoint defines them, and the representation file also stores the set of currently enabled viewpoints in the session.

This means the representation file contains the representation and session data, references the semantic models, and also references the VSMs which define the representations it contains.

The meta-model for representation files is defined in the http://www.obeo.fr/dsl/viewpoint/1.1.0 package, from the main fr.obeo.dsl.viewpoint plug-in. As is the case for VSMs, this package defines both the overall structure of the representation files and, for historical reasons, the representation data used for diagrams. Sequence diagrams, tables and trees define their own meta-models to describe their representations' data:

The concrete structure of an aird file is the following: An aird resource contains a single DAnalysis. The analysis references the top-level elements of all the semantic resources in the session, via its models reference, and may reference other «sub-aird» through its referencedAnalysis reference. It also contains through ownedViews a DRepresentationContainer for every Viewpoint which was ever enabled in the session. The sub-set of ownedViews in selectedViews corresponds to the Viewpoints currently enabled in the session. Each DRepresentationContainer references (through viewpoint) the viewpoint definition it is an «instance» of, and contains actual representations (from that viewpoint) in ownedRepresentations.

The structure of the representations themselves depend on each dialect, which defines its own meta-model as mentioned above. However, they all use the fr.obeo.dsl.viewpoint.DSemanticDecorator interface for representation elements which stand for semantic elements. The getTarget() method of DSemanticDecorator can be used to obtain the actual semantic target element being represented. This means that both a node on a diagram (which is a DNode) and a cell in a table (a DCell), and any other representation element in Viewpoint, share the same API to retrieve the element in the user’s semantic model that it represents.