The object constraint language: precise modeling with UML

(All chapters conclude with "Summary".) Foreword. Preface. Acknowledgments. Introduction. Who Should Read This Book. How This Book Should Be Used. Typeface Conventions. Information on Related Subjects. 1. Why Write Constraints? Definition of Constraint. Use of Constraints in Other Techniques. Design by Contract. Definition of Contract. Contents of a Contract. Advantages of Contracts. Preconditions and Postconditions. Invariants. Advantages of Constraints. Better Documentation. Improved Precision. Communication without Misunderstanding. Declarative or Operational Constraints. Advantages of a Declarative Language. Notation: Natural Language or Mathematical Expressions. Summary: Requirements for OCL. 2. OCL Basics. The "Royal and Loyal" System Example. Putting Invariants on Attributes. Putting Invariants on Associated Classes. Dealing with Collections of Objects. Sets, Bags, and Sequences. Inheritance. Working with Enumerations. Writing Preconditions and Postconditions. Where to Start Writing Invariants. Broken Constraints. Summary. 3. The Complete Overview of OCL Constructs. Types and Instances. Value Types and Object Types. OCL Expressions and OCL Constraints. The Context of an OCL Expression. The Context of an Invariant. The Context of a Pre- or Postcondition. The self Keyword. Basic Types and Operators. The Boolean Type. The Integer and Real Types. The String Type. Model Types. Attributes from the UML Model. Operations from the UML Model. Class Operations and Attributes from the UML Model. Associations and Aggregations from the UML Model. Association Classes from the UML Model. Qualified Associations from the UML Model. Using Package Names in Navigations. Using Pathnames in Inheritance Relations. Enumeration Types. The Set, Bag, and Sequence Types. Treating Instances as Collections. Flattening Collections. Operations on All Collection Types. Operations with Variant Meaning. Operations for the Set Type. Operations for the Sequence Type. Operations That Iterate over Collection Elements. The select Operation. The reject Operation. The collect Operation. Shorthand Notation for collect. The forAll Operation. The exists Operation. The iterate Operation. Constructs for Postconditions. Operations Defined on Every OCL Type. Types as Objects. Type Conformance Rules. Precedence Rules. Comments. Undefined. Summary. 4. Modeling with Constraints. Constraints in a UML Model. Invariants. Invariants for Derived Attributes or Associations. Preconditions and Postconditions. Guards in State Transition Diagrams. Using Guards and Events in Pre- and Postconditions. Change Events in State Transition Diagrams. Type Invariants for Stereotypes. Where OCL Expressions Can Be Used. Constraints and Inheritance. Styles for Specifying Constraints. Avoiding Complex Navigation Expressions. Choice of Context Object. Use of allInstances. Splitting and Constraints. Adding Extra Operations or Attributes. Using the collect Shorthand. Solving Modeling Issues with Constraints. Abstract Classes. Specifying Uniqueness Constraints. Adding Details to the Model versus Adding Constraints. Cycles in Class Models. Constraints on Associations. Multiplicity Constraints. The Subset Constraint. The Or Constraint. Optional Multiplicity in Associations. Summary. 5. Extending OCL. A Word of Caution. Extending the Standard OCL Types. Adding New OCL Types. Operational Use of Constraints. Generating Code for Constraints. When to Check Constraints. What to Do When the Constraint Fails. Summary. Appendix A. OCL Basic Types and Collection Types. Basic Types. OclType. OclAny. OclExpression. Real. Integer. String. Boolean. Enumeration. Collection-Related Types. Collection. Set. Bag. Sequence. Appendix B. Formal Grammar. Bibliography. Index. 0201379406T04062001