HOME

TheInfoList



OR:

The Object Constraint Language (OCL) is a declarative language describing rules applying to
Unified Modeling Language The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally ...
(UML) models developed at IBM and is now part of the UML standard. Initially, OCL was merely a formal specification language extension for UML. OCL may now be used with any Meta-Object Facility (MOF)
Object Management Group The Object Management Group (OMG) is a computer industry standards consortium. OMG Task Forces develop enterprise integration standards for a range of technologies. Business activities The goal of the OMG was a common portable and interoperab ...
(OMG) meta-model, including UML. The Object Constraint Language is a precise text language that provides constraint and object query expressions on any MOF model or meta-model that cannot otherwise be expressed by diagrammatic notation. OCL is a key component of the new OMG standard recommendation for transforming models, the Queries/Views/Transformations ( QVT) specification.


Description

OCL is a descendant of Syntropy, a second-generation object-oriented analysis and design method. The OCL 1.4 definition specified a constraint language. In OCL 2.0, the definition has been extended to include general object query language definitions. OCL statements are constructed in four parts: # a context that defines the limited situation in which the statement is valid # a property that represents some characteristics of the context (e.g., if the context is a class, a property might be an attribute) # an operation (e.g., arithmetic, set-oriented) that manipulates or qualifies a property, and # keywords (e.g., if, then, else, and, or, not, implies) that are used to specify conditional expressions.


Relation


OCL and UML

OCL supplements
UML The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally ...
by providing expressions that have neither the ambiguities of natural language nor the inherent difficulty of using complex mathematics. OCL is also a navigation language for graph-based models.


OCL and MOF

OCL makes a Meta-Object Facility model more precise by associating assertions with its meta-elements.


OCL and QVT

Of particular importance to Model Driven Engineering (MDE) or
model-driven architecture Model Driven Architecture (MDA) is a software design approach for the development of software systems. It provides a set of guidelines for the structuring of specifications, which are expressed as models. Model Driven Architecture is a kind of doma ...
is the notion of Model transformation. The
OMG OMG may refer to: * Oh my God (sometimes also Oh my Goodness or Oh my Gosh), a common abbreviation, often used in SMS messages and Internet communication Acronyms * OMG is the IATA code for Omega Airport, Omega, Namibia * Operational manoeuvre ...
has defined a specific standard for model transformation called MOF/QVT or in short QVT. Several model transformation languages like
GReAT Great may refer to: Descriptions or measurements * Great, a relative measurement in physical space, see Size * Greatness, being divine, majestic, superior, majestic, or transcendent People * List of people known as "the Great" *Artel Great (born ...
, VIATRA, or Tefkat are presently available, with different levels of compliance with the QVT standard. Many of these languages are built on top of OCL, which is the main part of the QVT-compliance.


Alternatives

Being a rule-based validation language, Schematron may be considered an alternative to OCL. However Schematron works for Extensible Markup Language (XML) trees while OCL makes it possible to navigate MOF-based models and meta-models (i.e. XML Metadata Interchange ( XMI) trees). In other words, OCL relates to
UML The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally ...
or MOF similarly to how Schematron relates to
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. ...
. (Note that Schematron uses
XPath XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) and can be used to compute values (e.g., strings, numbers, or Boolean v ...
to navigate inside the XML trees.)
Being a model specification language permitting designers to decorate a model or a meta-model with side-effect-free annotations, OCL could be replaced by languages like
Alloy An alloy is a mixture of chemical elements of which at least one is a metal. Unlike chemical compounds with metallic bases, an alloy will retain all the properties of a metal in the resulting material, such as electrical conductivity, ductilit ...
. Automated OCL generation is in principle possible from natural language.


Extensions

Eclipse OCL extends Standard OCL with additional operators and a type for Maps. AgileUML extends Standard OCL with Map and Function types. These extensions are consistent with the map and function types present in modern programming languages such as Python and Swift.


See also

*
Computer model Computer simulation is the process of mathematical modelling, performed on a computer, which is designed to predict the behaviour of, or the outcome of, a real-world or physical system. The reliability of some mathematical models can be det ...
*
Data mapping In computing and data management, data mapping is the process of creating data element mappings between two distinct data models. Data mapping is used as a first step for a wide variety of data integration tasks, including: * Data transformat ...
*
Domain Specific Language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging f ...
(DSL) * Domain-specific modelling (DSM) *
Eclipse An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
br>GMT Project
* Gello Expression Language * Glossary of Unified Modeling Language terms * Intentional Programming (IP) *
List of UML tools A ''list'' is any set of items in a row. List or lists may also refer to: People * List (surname) Organizations * List College, an undergraduate division of the Jewish Theological Seminary of America * SC Germania List, German rugby unio ...
* Meta-modeling * Meta-modeling technique * Meta-Object Facility (MOF) * Metadata *
Model-based testing Model-based testing is an application of model-based design for designing and optionally also executing artifacts to perform software testing or system testing. Models can be used to represent the desired behavior of a system under test (SUT), ...
(MBT) *
Model-driven architecture Model Driven Architecture (MDA) is a software design approach for the development of software systems. It provides a set of guidelines for the structuring of specifications, which are expressed as models. Model Driven Architecture is a kind of doma ...
(MDA) * Model Driven Engineering (MDE) * Model Transformation Language (MTL) * Modeling language * Modeling perspectives * MOFM2T * Object-oriented analysis and design (OOAD) * MOF Queries/Views/Transformations (QVT) * Semantic translation * Transformation language (TL) * UML tool *
Vocabulary-based transformation In metadata, a vocabulary-based transformation (VBT) is a transformation aided by the use of a semantic equivalence statements within a controlled vocabulary. Many organizations today require communication between two or more computers. Althoug ...
* XMI * XML transformation language (XTL)


References


External links


OMG OCL specification

OCL Portal - The center for OCL related information


(brief OCL 2.0 syntax)
Octopus: OCL Tool for Precise Uml Specifications
(OCL checker)
Dresden OCL Toolkit
(OCL Toolkit, various OCL related publications)
HOL-OCL
(An interactive theorem proof environment for OCL, various OCL related publications)
OCL for Java tutorial on ParlezUML





USE (UML-based Specification Environment)
(OCL Tool for model validation, various OCL related publications)
OCL tutorial

NL2OCL
(OCL Tool for invariant generation from NL) {{ISO standards Unified Modeling Language Formal specification languages ISO standards