Object Constraint Language
Encyclopedia
The Object Constraint Language (OCL) is a declarative language for describing rules that apply to Unified Modeling Language
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 (UML) models developed at IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

 and now part of the UML standard. Initially, OCL was only a formal specification language extension to UML. OCL may now be used with any Meta-Object Facility
Meta-Object Facility
The Meta-Object Facility is an Object Management Group standard for model-driven engineering. The official reference page may be found at OMG's website.- Overview :...

 (MOF) Object Management Group
Object Management Group
Object Management Group is a consortium, originally aimed at setting standards for distributed object-oriented systems, and is now focused on modeling and model-based standards.- Overview :...

 (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
QVT
QVT is a standard set of languages for model transformation defined by the Object Management Group .- Overview :...

) specification.

Description

OCL is a descendant of Syntropy
Syntropy
Syntropy is a second-generation object-oriented analysis and software design method developed at Object Designers Limited in the UK during the early 1990s. The goal in developing Syntropy was to provide a set of modelling techniques that would allow precise specification and would keep separate...

, 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:
  1. a context that defines the limited situation in which the statement is valid
  2. a property that represents some characteristics of the context (e.g., if the context is a class, a property might be an attribute)
  3. an operation (e.g., arithmetic, set-oriented) that manipulates or qualifies a property, and
  4. keywords (e.g., if, then, else, and, or, not, implies) that are used to specify conditional expressions.

OCL and UML

OCL supplements UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 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
Meta-Object Facility
The Meta-Object Facility is an Object Management Group standard for model-driven engineering. The official reference page may be found at OMG's website.- Overview :...

 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
Model-driven architecture 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 domain engineering, and supports model-driven engineering of...

 is the notion of Model transformation
Model transformation
A model transformation, in model-driven engineering, is an automatable way of ensuring that a family of models is consistent, in a precise sense which the software engineer can define...

. The OMG
Object Management Group
Object Management Group is a consortium, originally aimed at setting standards for distributed object-oriented systems, and is now focused on modeling and model-based standards.- Overview :...

 has defined a specific standard for model transformation called MOF/QVT or in short QVT
QVT
QVT is a standard set of languages for model transformation defined by the Object Management Group .- Overview :...

. Several model transformation languages like GReAT
GReAT
Graph Rewriting and Transformation is a Model Transformation Language for Model Integrated Computing available in the GME environment. GReAT has a rich pattern specification sublanguage, a graph transformation sublanguage and a high level control-flow sublanguage. It has been designed to address...

, VIATRA
VIATRA
The VIATRA framework is the core of a transformation-based verification and validation environment for improving the quality of systems designed using the Unified Modeling Language by automatically checking consistency, completeness, and dependability requirements.- Target Application Domains...

, or Tefkat
Tefkat
Tefkat is a Model Transformation Language and a model transformation engine. The language is based on F-logic and the theory of stratified logic programs. The engine is an Eclipse plug-in for the Eclipse Modeling Framework .- History :...

 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
QVT
QVT is a standard set of languages for model transformation defined by the Object Management Group .- Overview :...

-compliance.

Alternatives

As a rule-based validation language, Schematron
Schematron
In markup languages, Schematron is a rule-based validation language for making assertions about the presence or absence of patterns in XML trees...

 may be considered as an alternative to OCL. However Schematron works for Extensible Markup Language (XML) tree
XML tree
XML documents have a hierarchical structure and can conceptually be interpreted as a tree structure, called an XML tree.This tree structure can not be divided into just root, nodes and leaves as normal tree structures...

s while OCL makes it possible to navigate MOF
Meta-Object Facility
The Meta-Object Facility is an Object Management Group standard for model-driven engineering. The official reference page may be found at OMG's website.- Overview :...

-based models and meta-models (i.e. XML Metadata Interchange (XMI) trees). In other words, OCL has a similar relation to UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 or MOF as Schematron has to XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

. (Note that Schematron uses XPath
XPath
XPath is a language for selecting nodes from an XML document. In addition, XPath may be used to compute values from the content of an XML document...

 to navigate inside the XML trees.) />As 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
Alloy language
In computer science and software engineering, the Alloy Analyzer is a software tool which can be used to analyze specifications written in the Alloy specification language. The Analyzer can generate instances of model invariants, simulate the execution of operations defined as part of the model,...

.

See also

  • Computer model
  • Data mapping
    Data mapping
    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:...

  • Domain Specific Language  (DSL)
  • Domain-specific modelling (DSM)
  • Eclipse
    Eclipse (software)
    Eclipse is a multi-language software development environment comprising an integrated development environment and an extensible plug-in system...

     GMT Project
  • Gello Expression Language
    Gello Expression Language
    The GELLO Expression Language was started in 2001 and introduced in 2002; in 2005, GELLO was adopted as an international standard by HL7 International and ANSI for a decision support language...

  • Glossary of Unified Modeling Language terms
    Glossary of Unified Modeling Language terms
    This glossary of Unified Modeling Language terms covers all versions of UML. Individual entries will point out any distinctions that exist between versions.-A:...

  • Intentional Programming
    Intentional Programming
    In computer programming, intentional programming is a collection of concepts which enable software source code to reflect the precise information, called intention, which programmers had in mind when conceiving their work...

     (IP)
  • List of UML tools
  • Meta-model
  • Meta-modeling
  • Meta-modeling technique
  • Meta-Object Facility
    Meta-Object Facility
    The Meta-Object Facility is an Object Management Group standard for model-driven engineering. The official reference page may be found at OMG's website.- Overview :...

     (MOF)
  • Metadata
    Metadata
    The term metadata is an ambiguous term which is used for two fundamentally different concepts . Although the expression "data about data" is often used, it does not apply to both in the same way. Structural metadata, the design and specification of data structures, cannot be about data, because at...

  • Model-based testing
    Model-based testing
    Model-based testing is the application of Model based design for designing and optionally executing the necessary artifacts to perform software testing. Models can be used to represent the desired behavior of the System Under Test , or to represent the desired testing strategies and testing...

     (MBT)
  • Model-driven architecture
    Model-driven architecture
    Model-driven architecture 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 domain engineering, and supports model-driven engineering of...

     (MDA)
  • Model Driven Engineering (MDE)
  • Model Transformation Language
    Model Transformation Language
    A model transformation language in systems and software engineering is a language for model transformation.- Overview :The notion of model transformation is of central importance to information technology. A software system may be seen as a set of information transformations...

     (MTL)
  • Modeling language
    Modeling language
    A modeling language is any artificial language that can be used to express information or knowledge or systems in a structure that is defined by a consistent set of rules...

  • Modeling perspectives
    Modeling perspectives
    A modeling perspective in information systems is a particular way to represent pre-selected aspects of a system. Any perspective has a different focus, conceptualization, dedication and visualization of what the model is representing....

  • MOFM2T
  • Object-oriented analysis and design
    Object-oriented analysis and design
    Object-oriented analysis and design is a software engineering approach that models a system as a group of interacting objects. Each object represents some entity of interest in the system being modeled, and is characterised by its class, its state , and its behavior...

     (OOAD)
  • MOF Queries/Views/Transformations
    QVT
    QVT is a standard set of languages for model transformation defined by the Object Management Group .- Overview :...

     (QVT)
  • Semantic translation
    Semantic translation
    Semantic translation is the process of using semantic information to aid in the translation of data in one representation or data model to another representation or data model...

  • Transformation language
    Transformation language
    A transformation language is a computer language designed to transform some input text in a certain formal language into a modified output text that meets some specific goal....

     (TL)
  • UML tool
    UML tool
    A UML tool or UML modeling tool is a software application that supports some or all of the notation and semantics associated with the Unified Modeling Language , which is the industry standard general purpose modeling language for software engineering.UML tool is used broadly here to include...

  • Vocabulary-based transformation
    Vocabulary-based transformation
    In metadata, a vocabulary-based transformation is a transformation aided by the use of a semantic equivalence statements within a controlled vocabulary.Many organizations today require communication between one or more computers...

  • XMI
  • XML transformation language
    XML transformation language
    An XML transformation language is a programming language designed specifically to transform an input XML document into an output XML document which satisfies some specific goal.There are two special cases of transformation:...

    (XTL)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK