1.1 MetaEdit+ data model: GOPPRR
The basic requirement for implementing a modeling language
with a language workbench is the specification of the language definition. For
this purpose, MetaEdit+ uses the GOPPRR metamodeling framework. GOPPRR
specifications of the modeling language are made with the metamodeling tools of
MetaEdit+ Workbench. The metamodels thus made are read by MetaEdit+ to configure
itself to provide the support environment for the modeling language.
Although more familiar languages from other domains can
also capture some of the information necessary in metamodels, GOPPRR is
preferred here because it was specifically designed for describing modeling
languages. Using a domain-specific modeling language for the task of
metamodeling brings the same benefits as the use of DSM in any domain:
simplicity, precision, and automation. Languages like UML, MOF and ER were
intended for other domains, entailing greater effort, loss of precision, and
risk of misunderstanding for the reader.
Before looking at metamodels, we will start with an
example model of a simple digital wristwatch application (
Figure 1–1).
Figure 1–1. The GOPPRR concepts in an example diagram.
This
diagram describes the state machine implementing a simple time display and
timeunit editing application for a digital wristwatch. We have labeled some
examples of the basic constructs that can be found in all models, whatever their
language.
| A
graph is one individual model, often shown as a diagram (as
above) |
| Objects
are the main elements of graphs, often shown as boxes or circles (e.g.
‘Show’, ‘Mode’, and ‘clockTime’ in Figure
1–1). |
| A
relationship connects objects together (like the one connecting
‘EditMinutes’ and ‘Show’ in the diagram
above) |
| A
role connects an object into a relationship, shown as a line and often an
arrow-head |
| A
port is a specific connectable area on the object for the role to connect to
(Ports are not a mandatory part of the role-object construct but can be left
away in which case the role connects directly to the
object) |
| A
property is an attribute characterizing one of the above, often shown as a
label |
We will call these basic constructs
metatypes. The table below lists some example instance elements of this
model, their types, and their metatypes.
Instance
|
Type
|
Metatype
|
Simple
|
WatchApplication
|
Graph
|
Show
|
State [Watch]
|
Object
|
The connection between “EditMinutes” and
“Show”
|
Transition
|
Relationship
|
Arrow-head at ‘Show’
|
To
|
Role
|
“Set”, “editOffset”
|
Button name, DisplayFn
|
Property
|
In addition to these metatypes, some modeling languages also
use ports: specific points on the edge of an object symbol to which roles can
connect. Together, these six metatypes form the concepts of GOPPRR, which we
will describe in more detail below.