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:

    The essence of friendship is entireness, a total magnanimity and trust. It must not surmise or provide for infirmity. It treats its object as a god, that it might deify both.
    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)

    Wealth is so much the greatest good that Fortune has to bestow that in the Latin and English languages it has usurped her name.
    William Lamb Melbourne, 2nd Viscount (1779–1848)