<< 1 >>
Rating: Summary: Effective use of mathematics to describe code Review: As a mathematician, I have always been drawn to the more formal programming methods of the Object Constraint Language (OCL). With it, you can place precise mathematical descriptions of what must be true before the code executes and what is guaranteed to be true after the code has run. Given the concise nature of mathematical notation, the OCL expressions also can replace many times their text in comments. The combination of Unified Modeling Language (UML) and OCL is a powerful one, allowing you to precisely describe the actions that code is expected to perform. However, the OCL is unlike other formal mathematical languages in that it must change in response to new ways of creating code.
One of the newest ways to design software systems is to use Model Driven Architectures (MDAs). An MDA is a high level framework that describes how models can be translated from language to language. Since the purpose is to allow for the translation to be done by machine, it is necessary for all restrictions to be written in a clear, unambiguous manner. Currently, the MDA process is divided into three steps:
The Platform Independent Model (PIM), which is at the highest level of abstraction and is independent of any specific technology.
The PIM is then translated into one or more Platform Specific Models (PSMs), where platform specific features are incorporated into each PSM.
Each PSM is then converted into code to be run on the specific platform.
When I first encountered the fundamentals of MDAs, my skepticism meter rose to a high level. Even with the precision of UML, creating accurate models is very hard, and creating appropriate code from those models is probably harder. Sure, it is possible to create the constructors, setters and getters and other simple components of a class automatically, but code is so complex that it is difficult to look at a model and know precisely what it is supposed to do.
After reading this book, the level of my skepticism meter has dropped quite a bit. From the presentation, it is easy to see how important OCL is to the accurate rendition of code from models. In fact, it is hard to believe that MDA could possibly succeed without OCL being heavily incorporated into the models.
The opening chapter of the book is a brief explanation of MDAs and how UML and OCL are used in combination to create the models. A solid introduction to the MDA way of doing things, it also describes the foundations, but not the specifics of OCL. It is assumed that the reader is familiar with the UML. In chapter two, the OCL is described using an example of a customer loyalty program. This is an excellent example, as it is easy to understand and allows most of the basic expressions of the OCL to be used.
Chapter three is where the specifics of how the OCL is used in models are covered. While the examples are well done, one does not skim this chapter and understand it. The combination of diagrams and constraints must be read with a great deal of care in order to understand them. I was impressed with this approach, as the authors did not sacrifice accuracy of rendition for simplicity of understanding. The coverage of chapter four is in how the OCL is implemented and chapter five describes how the structures of the OCL are used in the creation of MDA models. This is where the UML and OCL metalanguages are merged to describe the functions of software. Once again, be prepared to spend some time in examining the diagrams in great detail. I found myself reading and rereading some of the examples before I achieved an acceptable level of understanding.
The final sections of the book form an OCL reference manual, where many of the expressions of the OCL are demonstrated in the appropriate context. In general, they are demonstrated in circumstances independent of an MDA model, which is an appropriate simplification.
There are reasons to believe that the MDA approach to software is not yet mature enough to be trusted. Nevertheless, the advantages of using it in any way are enormous, and it cannot be used without a way to accurately express the environment in which segments of code are to run. The OCL provides a way to describe the environment and from this book you can learn how the UML and the OCL can be combined to create models with the required degree of precision necessary for the automatic translation of an MDA into code.
Published in the online Journal of Object Technology, reprinted with permission.
Rating: Summary: Needs to be reorganized - too much repetition Review: I am puzzled that the any reviewer could give this book 5 stars - I can only give it 3 for the following reasons:1) It is repetitive - Chapter 2, "OCL by example", covers much the same material that is presented in more detail in Chapter 3, "Building models with OCL" and also (in yet more detail) in Part 2, the "Reference Manual". Chapters 2 and 3 at least could be consolidated. 2) The book lacks focus and sometimes seems to ramble around lots of different topics. 3) For me, the book makes OCL, a fundamentally simple langauge, appear complex. This is largely because the explanations of OCL concepts are not clear or concise enough and are not presented soon enough or consistently enough. I also think that the authors could spend more time working out better examples and could express more of the OCL expressions in English to help the reader. Some diagrams illustrating some of the OCL expressions navigation paths through the models would be helpful. 4) The book lacks cohesion - it feels like lots of bits and pieces put together rather than a clear, focused exposition of OCL. 5) In some places it reads like an OCL apologia. For example the authors at one point state that if you don't like OCL syntax (and a lot of people don't) then you can create your own syntax. This is an accurate statement, but misses the point by a mile! 6) In some places it reads like an OCL sales pitch. I don't think the book presents a balanced view of OCL. It would be nice to have sections discussing some of the problems with OCL (and how to get around them) and perhaps a section discussing why it has been so slow to get off the ground (if indeed it has got off the ground yet). Jos Warmer is the primary author of the OCL so we can expect some bias, but I would have liked a more balanced approach. 7) Chapter 5, "Using OCL for MDA" seems to be redundant. The language used in Chapter 5 is not OCL - it is an extended non-standard version of OCL. I think that the chapter is trying to position OCL as the basis of the QVT (Query/Views/Transformations) language that is subject of an OMG RFP. Unfortunately this chapter might prove to be an own goal because on page 102 you see that a large amount of extended OCL code is needed to specify one of the most simple transformations possible. You come away from the chapter thinking that there just has to be a better way to do it than this! 8) All the UML models could be layed out more neatly. For example, figure 2.1, which is a key figure, is a bit of a mess - lots of bent lines, constraints, role names and multiplicities all close together and interfering with each other. A bit of time spent laying out the diagrams could make all the models much easier to read. This would make the whole book more appealing and easier to read. Despite what I've said above, there is still a lot to like about this book (hence the 3 stars). It succeeds in providing a reasonable OCL reference and some sections (e.g. 3.10, "Tips and Hints") are very good.
Rating: Summary: Added value Review: The Object Constraint Language Second Edition written by Anneke Kleppe and Jos Warmer, explains in no time, how to complete your Platform Independent Models, with business and query language. The UML2.0 renewed emphasis on the Object Constraint Language extends the functionality needed to model more, and to program less. This book focuses on the Business Rules implementation in MDA, and brings the details needed. Step by step the book explains the OCL language and provides the reader with the knowledge to use OCL from a MDA point of view using transformation examples translating OCL to Java business rules. This book can be considered as "Added value", also when readers are already familiar with the book 'MDA Explained The Model Driven Architect Practice and Promise book written by Anneke Kleppe, Jos Warmer and Wim Bast'. The overlap is small. Using the theory from the books, I succeeded in writing a bridge from Uniface to UML using XMI and visa versa. In MDA terminology we transform a Platform Independent Model (PIM) to a Platform Specific Model (PSM). We translate an Object Oriented Model to a Entity Relationship Model, including the OCL translation to simple business rules. Have fun reading
Rating: Summary: OK for experienced programmers Review: This book really is for experienced programmers. It presupposes a strong familiarity with UML, and even some knowledge of MDA. Given that, the reader should be able to place the OCL within the UML framework. The example used throughout the book is helpful, since it gives a moderately realistic setting showing how OCL describes real application logic. Experienced programmers will also be able to unwind the non-intuitive order of presentation. The book starts with the examples, giving a rough idea of OCL's relationship to the more familiar UML class, object, state, and interaction diagrams. Next, it shows how the OCL can be rendered in Java langauge syntax, and finally the OCL language is presented. I would much rather have seen the language definition, then the example, then the sample langauge binding - a beginner is likely to need at least two or three readings to resolve all of the book's implicit forward references. It will also take an experienced programmer to step over the book's occasional errors. For example, pp49-50 seem to confuse inclusive and exclusive OR semantics. An example on p.86 first confuses the Java equality test and assignment operators, then confuses object identity and value equality testing. An experienced reader will also forgive erratic editing, such as p.97's reference to a banana's "peal." (As a matter of record, I tried pealing a banana the way I would peal a bell and got disappointing results.) Most of all, it will take an experienced reader to sort out the different meta-levels of representation. At different times, the OCL is presented as a tool that talks about the model of the program and as a tool that specifies the content of the program. I can go either way or both ways, but a beginner would probably get lost at one meta-level or another. Experienced programmers will also forgive the vague connection between the OCL and other parts of the UML standard. Those connections are very tool-dependent, and the tools don't exist yet. This is about the first book on OCL, though, so I have to cut some slack for it. The OCL is an advanced part of the "Model Description Architecture". The MDA is so advanced that it doesn't even exist at this writing, in any way a programmer can use. I'm sure that, once the MDA becomes common in the field, more effective OCL teaching tools will also appear. Until then, this is an interesting, if somewhat murky peek into the future of software methodology.
Rating: Summary: Take your Software Engineering Skills to the next level Review: 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.
Rating: Summary: Take your Software Engineering Skills to the next level Review: 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.
<< 1 >>
|