ECO (Domain Driven Design) - Object Constraint Languages

Object Constraint Languages

OCL is often referred to as an object analog for SQL since OCL provides a means to make queries in terms of objects. ECO uses its own OCL editor with syntax check and expression assistant in order to simplify writing type safe OCL expressions. The ECO OCL editor validates OCL expressions also against the actual model context. The following OCL expression selects company employee objects representing employees older than 30 years. If persisted object instances are not present in memory when the OCL expression is evaluated, they will be automatically loaded into memory by the ECO framework:

company.employees->select(age > 30)

Originally OCL was proposed by OMG as a means of describing constraints in UML models, but the usage area of OCL is actually much wider. In ECO OCL is used to express:

  • Queries to the DB
  • In-memory queries
  • Evaluation expressions for derived class members (attributes and links)
  • Constraints

Standard OCL is a side-effect free language in that it doesn't allow making changes to a system. For this reason ECO has an OCL extension called EAL (ECO Action Language) which makes it possible to change an object member, to call methods and even to create new object instances. EAL provides a simple means to write state machine trigger effect or a class method instead of using standard C# or Delphi.NET language. OCL/EAL functionality can be defined directly in the UML model.

Read more about this topic:  ECO (Domain Driven Design)

Famous quotes containing the words object, constraint and/or languages:

    A healthy soul stands united with the Just and the True, as the magnet arranges itself with the pole, so that he stands to all beholders like a transparent object betwixt them and the sun, and whoso journeys towards the sun, journeys towards that person. He is thus the medium of the highest influence to all who are not on the same level.
    Ralph Waldo Emerson (1803–1882)

    In America a woman loses her independence for ever in the bonds of matrimony. While there is less constraint on girls there than anywhere else, a wife submits to stricter obligations. For the former, her father’s house is a home of freedom and pleasure; for the latter, her husband’s is almost a cloister.
    Alexis de Tocqueville (1805–1859)

    No doubt, to a man of sense, travel offers advantages. As many languages as he has, as many friends, as many arts and trades, so many times is he a man. A foreign country is a point of comparison, wherefrom to judge his own.
    Ralph Waldo Emerson (1803–1882)