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 "MDT/New and Noteworthy/1.1"

< MDT
m (image formatting)
(More new OCL API)
Line 40: Line 40:
 
and on instance specifications in UML models:
 
and on instance specifications in UML models:
 
[[Image:unnamed-assoc-ends-M1.png|thumb|none|Navigating unnamed model association ends]]
 
[[Image:unnamed-assoc-ends-M1.png|thumb|none|Navigating unnamed model association ends]]
 +
 +
 +
==== Other New API ====
 +
 +
As part of the refactoring of the parser API, this milestone introduces some new optional interfaces that environments may choose to implement.  To maintain API compatibility, OCL employs an optional
 +
<tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/util/Adaptable.html Adaptable]</tt> interface similar to Eclipse Platform's <tt style="color:green">IAdaptable</tt> that is available is stand-alone deployments.  The
 +
<tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/util/OCLUtil.html#getAdapter(org.eclipse.ocl.Environment,%20java.lang.Class) OCLUtil]</tt> class provides utilities
 +
to obtain adapters from parsing and evaluation environments for these optional interfaces.
 +
 +
One noteworthy new optional interface is
 +
<tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/options/Customizable.html Customizable]</tt>, which
 +
defines a protocol for customizing the parsing and evaluation of OCL constraints via
 +
<tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/options/Option.html Option]</tt>s.  Parsing options available so far include:
 +
 +
:* <tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/options/ProblemOption.html ProblemOption]</tt>, an enumeration of parsing problems for which clients can choose the severity (reported as <tt style="color:green">Diagnostic</tt>s or as <tt style="color:green">ParserException</tt>s
 +
:* <tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/uml/options/UMLParsingOptions.html#ASSOCIATION_CLASS_TYPE UMLParsingOptions::ASSOCIATION_CLASS_TYPE]</tt> for how to treat associations in the UML environment
 +
 +
Evaluation options available so far include:
 +
 +
:*<tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/options/EvaluationOptions.html#LAX_NULL_HANDLING EvaluationOptions::LAX_NULL_HANDLING]</tt> specifying how to evaluate certain of OCL's pre-defined operations when applied to <tt style="color:green">null</tt> and <tt style="color:green">OclInvalid</tt> values
 +
:*<tt>[http://download.eclipse.org/modeling/mdt/ocl/javadoc/1.2.0/org/eclipse/ocl/uml/options/UMLEvaluationOptions.html#EVALUATION_MODE UMLEvaluationOptions::EVALUATION_MODE]</tt> specifying whether evaluation is on instances of a UML2-generated metamodel or on instance specificiations in a UML model
  
 
==== Other Bug Fixes ====
 
==== Other Bug Fixes ====

Revision as of 13:35, 13 November 2007

Model Development Tools Release 1.1 New and Noteworthy Items.

For more details about the development plan, see the MDT 1.1 draft plan.

Back to Modeling Development Tools.

EMF Ontology Definition Metamodel (EODM) Component

TBD

Object Constraint Language (OCL) Component

Release 1.2 M3

OCL Grammar and Parser API Refactoring

This milestone delivers the long-awaited refactoring of the OCL LPG grammar and associated parser API, contributed by Ed Willink from the GMT project's UMLX component.

The major new API in this contribution is defined in the org.eclipse.ocl.lpg and org.eclipse.ocl.parser packages. Included is an implementation of an EssentialOCL grammar (EssentialOCL.g) which is included in the full grammar (OCLParser.g). The former OCLParser class (which was internal) is refactored to separate the concrete syntax and abstract syntax parsing phases, implemented by the public classes OCLParser and [1] OCLAnalyzer, respectively.

Abstract LPG-parsing API is provided by the org.eclipse.ocl.lpg package, with abstract definitions of lexers, parsers, and analyzers. These are accompanied by a BasicEnvironment interface that provides core services such as a new pluggable ProblemHandler for flexible reporting of parsing/analysis problems.

See Bug 176110 for further details.

Navigation of Unnamed Association Ends

The UML metamodel binding now supports parsing and evaluation of OCL expressions that navigate unnamed association ends. The OCL convention for unnamed ends defines an implicit name which is the name of the classifier at that end with the initial letter in lower case. MDT OCL supports evaluation of such navigation expressions, where the implicit end name is unambiguous, on:

instances of UML2-generated metamodels:

Navigating unnamed metamodel association ends

and on instance specifications in UML models:

File:Unnamed-assoc-ends-M1.png
Navigating unnamed model association ends


Other New API

As part of the refactoring of the parser API, this milestone introduces some new optional interfaces that environments may choose to implement. To maintain API compatibility, OCL employs an optional Adaptable interface similar to Eclipse Platform's IAdaptable that is available is stand-alone deployments. The OCLUtil class provides utilities to obtain adapters from parsing and evaluation environments for these optional interfaces.

One noteworthy new optional interface is Customizable, which defines a protocol for customizing the parsing and evaluation of OCL constraints via Options. Parsing options available so far include:

Evaluation options available so far include:

Other Bug Fixes

For other bug fixes, see the OCL 1.2 M3 release notes.

OCL Tools Component

OCL Tools is a recently added component to the Model Development Tools (MDT) Project aiming at providing first-class support to modelers working with specifications containing expressions written in OCL, the Object Constraint Language. Such support includes editing, refactoring, code generation, execution, and interactive debugging of the OCL constraints given for some underlying (Ecore or UML2) class model. The functionality of OCL Tools builds upon the MDT OCL component, and has been seeded with two initial contributions:

  • an OCL -> Java compiler, that as of now takes as input an .ecore and a textual file containing OCL constraints (handling UML2 is in the ToDo list). This compiler extends EMF code generation, producing Java 5 source code with side-effects-free methods for the given OCL invariants, pre- and postconditions, and derived attributes and operations.
  • an OCL text editor, supporting usability features such as AutoCompletion, navigation by means of hyperlinks, structured views (for the outline of a document and for the Abstract Syntax Tree of an OCL constraint), among others. Although MDT OCL itself is completely fluent in both Ecore and UML2, only the Ecore binding is supported by the OCL text editor at this time.

A longer intro to OCL Tools can be found at

Unified Modeling Language 2.x (UML2) Component

TBD

UML2 Tools Component

TBD

XML Schema Infoset (XSD) Component

TBD

Back to the top