June 16, 2011
New Forward For People Reading My Java OCL TutorialI checked the web stats for the recently relocated parlezuml.com site, and was slightly to dismayed to discover that the second most popular tutorial - after an introduction to use cases - is not something useful like TDD or refactoring, but (the horror!) the Object Constraint Language. What have thou wraught!
Let's face it, people only learn OCL to pass exams on OCL. In the real world, we don't use it.
So I've added a little forward to the Java OCL tutorial (nobody seems that interested in the .NET fersion, giving even stronger indications that it's being downloaded by university students and academics). Hopefully it will balance things out a little, and assuage some of my guilt.
If you're reading this tutorial, you're probably either studying for or teaching a computing or software engineering academic qualification.
How do I know this?
Simple. In the real world, almost nobody uses OCL. And by "almost nobody", I mean maybe 1/100 software professionals may have learned it. And maybe 1/100 of them ever use it. Learning OCL very probably is not going to get you a job as anything other than someone who teaches OCL.
I believe it is a useful skill to have if you want to really get to grips with UML, but I can state categorically, with my hand on my heart, than I have in my entire career used OCL in anger maybe twice.
Knowing OCL will not make you a better software developer, and you are unlikely to work with other software developers who know OCL, rendering it useless as a communication tool.
You may have been told about Model-driven Architecture. Back in 2000, it was going to be the next big thing. It wasn't.
On 99.9% of professional software projects, we still type code in a third-generation language into a text editor. Occasionally we draw UML diagrams on whiteboards when we want to visualise a design or analysis concept. You will find that some UML notations are still in widespread use - especially class and sequence diagrams, and activity diagrams for workflow analysis.
Consider OCL as being a classical language, like Latin or Ancient Greek.
It's useful to know, as it can give you some general background when applying things like Design By Contract, or even for functional programming. But it is, too all intents and purposes, a dead language.
Trust me, almost nobody out here speaks it.
Having said that, I hope you find this tutorial useful in passing your exams. And I look forward to maybe teaching you some useful skills - like test-driven development or refactoring - when you graduate and join the community of professional software developers.
Posted 7 years, 2 months ago on June 16, 2011