Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OCL/FAQ"

< OCL
m (MDT-UML2-OCL-FAQ moved to MDT-OCL-FAQ)
(What is MDT OCL?)
Line 1: Line 1:
{{stub}}
+
== What is MDT OCL? ==
  
== Question ==
+
MDT OCL provides a parser and interpreter for OCL constraints and
 +
expressions on any EMF-based metamodel.  By that is meant any
 +
metamodel whose meta-metamodel is Ecore, and which (in being a metamodel)
 +
provides an EMF importer to create GenModels that generate a Java
 +
implementation.
  
Answer.
+
So far, the Eclipse Modeling Project has two such metamodels:  Ecore and UML
 +
(Ecore being its own meta-metamodel).  Hence, the OCL component provides an
 +
OCL binding for each of these metamodels.  OCL can parse constraints in
 +
either Ecore or UML models, and can evaluate them on the instances of Java
 +
classes generated from these models.
  
== Another Question ==
+
In terms of the OMG's modeling "stack", then, we have in the Eclipse
 +
Modeling Project
 +
{| border="1"
 +
|+ align="bottom"|OCL's relation to the OMG modeling stack
 +
|-
 +
!Modeling Level!!Artifacts!!OCL's Role
 +
|-
 +
|M3||Ecore||This is the metamodel for the OCL Abstract Syntax Model
 +
|-
 +
|M2||Ecore, UML||OCL's generic AST model binds to these metamodels
 +
|-valign="top"
 +
|rowspan="2"| M1 ||*.ecore and *.uml models||rowspan="2"|OCL parses constraints on these models
 +
|-
 +
|generated Java code
 +
|-valign="top"
 +
|rowspan="2"| M0 ||instances of generated Java classes||rowspan="2"| OCL evaluates constraints on these objects
 +
|-
 +
|dynamic EMF objects
 +
|}
  
Answer, with quoted source code:
+
The OCL Abstract Syntax Model is, itself, actually a metamodel sitting at the M2 level.
 
+
some sample code here
+
another line of code
+
final bit of code
+
  
 
[[Category:Modeling]]
 
[[Category:Modeling]]
 
[[Category:MDT]]
 
[[Category:MDT]]

Revision as of 09:24, 11 May 2007

What is MDT OCL?

MDT OCL provides a parser and interpreter for OCL constraints and expressions on any EMF-based metamodel. By that is meant any metamodel whose meta-metamodel is Ecore, and which (in being a metamodel) provides an EMF importer to create GenModels that generate a Java implementation.

So far, the Eclipse Modeling Project has two such metamodels: Ecore and UML (Ecore being its own meta-metamodel). Hence, the OCL component provides an OCL binding for each of these metamodels. OCL can parse constraints in either Ecore or UML models, and can evaluate them on the instances of Java classes generated from these models.

In terms of the OMG's modeling "stack", then, we have in the Eclipse Modeling Project

OCL's relation to the OMG modeling stack
Modeling Level Artifacts OCL's Role
M3 Ecore This is the metamodel for the OCL Abstract Syntax Model
M2 Ecore, UML OCL's generic AST model binds to these metamodels
M1 *.ecore and *.uml models OCL parses constraints on these models
generated Java code
M0 instances of generated Java classes OCL evaluates constraints on these objects
dynamic EMF objects

The OCL Abstract Syntax Model is, itself, actually a metamodel sitting at the M2 level.

Back to the top