This books thru explanations, clear and concrete examples and a concise case study shows the reader how to take your software engineering skills to the next level. It shows practical uses and examples of the concepts that you leaned while studying Object Oriented concepts in school. For the Computer Scientists, this book is one smile after another of how some things that you always thought was great in concept have showed up in the real world. For a book that's less than 300 pages long, it sure compacts lots of information in there.
This was my encounter with the Object Constraint Language, or OCL. I have been using UML for work for a number of years now, but I never gave OCL a second thought other than a "nice-to-have-conpcept-that-makes-your-life-harder-than-its-worth" type of technology. This book was an eye opener. I am really glad that I took the time to real this book.
The book has three major parts:
1) User manual
2) Reference Manual
3) Appendices
By looking at the TOC, one is not really impressed. User manual? Reference Manual? I thought I am going to be bored to no end while reading this book. The TOC does not do justice to the book. The author in chapter 1 introduces MDA and its benefits (Portability, Productivity, Cross-platform interoperability, and easier maintenance and documentation). The author then introduces the concept of Modeling Maturity Levels (MML), which is very similar to the CMM levels for Software Engineering. MML has five levels and is used as an indication of, "...what role models play in your software development process, and the direction you need to take to improve this process."
i) Level 0: No Specification. Add-hoc development
ii) Level 1: Textual. Specs written in one or more natural language documents
iii) Level 2: Text with Diagrams. Several high-level diagrams are added to explain the over-all architecture
iv) Level 3: Models with Text. Models with a very specific and well-defined meaning, forms the specification of the software
v) Level 4: Precise Models. "A Model, meaning a consistent and coherent set of texts and/or diagrams with a very specific and well-defined meaning, specifies the software"
vi) Level 5: Models only. There will only be models and that is all.
Level 4, which is where MDA is targeted towards, is enabled only thru the use of a language such as OCL. I have never heard or seen anything on MML, but I certainly hope that people start using it more b/c it clearly explains an organization's software development process maturity.
In the rest of the chapters of part 1, the author goes thru extensive set of examples showing how to use OCL. Chapter 2, titled "OCL By Example" is a case study of what is referred to as a "Royal & Loyal" application in which there are tons of short, long, beginner, advanced, and everything in the middle types of examples.
One example of a concept that you would love to apply in the real world is the concept of "Design by Contract" (Chapter 3, page 43). There are a couple of books written on this topic (Meyer, McKim, etc...), but they all focus on Eiffel. OCL being language independent abstracts some of the limitations that some of the programming languages have and enables the developer to apply the idea of contracts thru preconditions and post-conditions. One still has to worry about the "under the hood" implementation of these concepts, but it is very nice to see that there are tools out there that are heading towards that direction. The author spends the rest of chapter 3 of the book applying OCL to various aspects of UML such a state charts, class diagrams, activity diagrams, component diagrams and Use-case diagrams.
A somewhat complete and good example of how OCL maps in to a programming language such a Java is shown in Chapter 4. It's a good reference, but at the beginning of the chapter, the author gives the URL of a web site that is dedicated to providing OCL implementation in various languages (http://www.klasse.nl/ocl/).
In part 2 of the book, various aspects of OCL such the context of an OCL expression are explained. The examples that were drawn in part 1 are used in go deeper into the heart of OCL and show the reader what is actually going on.
Chapters 7 thru 9, which are my favorite chapters in this book, are used to explain the elements of OCL. What makes up OCL? Data structures, user defined types, predefined types, and built-in operations. These chapters are truly reference manuals of OCL, but with tables, examples, and very short but sweet explanation of each topic. Each topic takes one-half or three-quarters of a page and is followed by a couple of examples. Chapter 9 on data structures that make up OCL (Bag, Set. OrderedSet, and Sequence) is probably the most important chapter of all three, since manipulation of collections is very common in almost any application.
All and all, the author did a great job showing the value and the promise of OCL as a technology that can take software engineering to its next level with the help of MDA.