OCL Expressions
No edit summary
mNo edit summary
Line 8: Line 8:


==== [[Part 3 OCL: Derivation properties]] ====
==== [[Part 3 OCL: Derivation properties]] ====
I often get the question if OCL is capable of doing everything we need to do in a line of business application. The answer is that as long as the arguments and result is representable in your model – yes it will do anything. Sometimes you have external or ambient data not accessible from the model – then you cannot use OCL – until you make that data available.
Not only can you do everything you need – it also comes out in small easily interpreted snippets of text that very much looks just like the requirements you are set to implement.
I like to compare OCL and modeling with Calculus. In math you can discuss numbers and operators on those number in plain language – but you seldom do since it will be error prune and require you to use a lot of words for even simple things. Instead everyone actually doing math uses calculus notation to write up expressions. The expressions are often reduced to the smallest possible – so that they are easily understood and ready to be used for a purpose.
Use OCL for the same reason but not on only numbers but on all your designed information. Imagine a world without a good way to declaratively work with math. In this world we would probably not have been able to do much cool technology. The ability to convey compact math between people is very good for mankind. I am certain that a good compact way to convey rules on information is equally important – if not even more usable – for mankind.

Revision as of 16:15, 13 August 2017

What is Object Constraint Language

The Object Constraint Language (OCL) is a declarative language for describing rules that apply to Unified Modeling Language (UML) models developed at IBM 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 (MOF) Object Management Group (OMG) meta-model, including UML.[2] 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.

Part 1 OCL Common Expressions

Part 2 OCL: Operators

Part 3 OCL: Derivation properties

I often get the question if OCL is capable of doing everything we need to do in a line of business application. The answer is that as long as the arguments and result is representable in your model – yes it will do anything. Sometimes you have external or ambient data not accessible from the model – then you cannot use OCL – until you make that data available.

Not only can you do everything you need – it also comes out in small easily interpreted snippets of text that very much looks just like the requirements you are set to implement.

I like to compare OCL and modeling with Calculus. In math you can discuss numbers and operators on those number in plain language – but you seldom do since it will be error prune and require you to use a lot of words for even simple things. Instead everyone actually doing math uses calculus notation to write up expressions. The expressions are often reduced to the smallest possible – so that they are easily understood and ready to be used for a purpose.

Use OCL for the same reason but not on only numbers but on all your designed information. Imagine a world without a good way to declaratively work with math. In this world we would probably not have been able to do much cool technology. The ability to convey compact math between people is very good for mankind. I am certain that a good compact way to convey rules on information is equally important – if not even more usable – for mankind.

This page was edited 44 days ago on 02/14/2024. What links here