The Object Constraint Language
Addison Wesley (Verlag)
978-0-201-37940-2 (ISBN)
- Titel erscheint in neuer Auflage
- Artikel merken
OCL complements the UML by providing a language for formally expressing the constraints of a model, a facility useful in user models as well as in the definition of the UML itself. Jos and Anneke provide a comprehensive and much-needed reference to this formalism.--Grady Booch, Ivar Jacobson, James Rumbaugh The Object Constraint Language (OCL) is a new notational language, a subset of the industry standard Unified Modeling Language, that allows software developers to write constraints over object models. These constraints are particularly useful, as they allow a developer to create a highly specific set of rules that governs the aspect of an individual object. As many software projects today require unique and complex rules that are written specifically for business models, OCL is fast becoming an integral facet of object development. This book is a practical guide to OCL for software architects, designers, and developers. Because it is designed for ease and usability, OCL is likely to gain broad acceptance. Much care has been taken during the design of OCL to ensure that the syntax is readable and writable by the average software modeler.
The straightforward nature of OCL makes it a natural candidate to supersede current constraint languages. The authors' pragmatic approach and illustrative use of examples will help application developers to get up to speed quickly with this important object modeling method. Other highlights: *Detailed instruction explains how and why to use OCL, showing its relation to UML *Illuminating case study demonstrates several UML diagrams and corresponding constraints *Provides keen insight from the primary author of the OCL standard portion of the UML 1.1 standard of the OMG 0201379406B04062001
Jos Warmer is the primary author of the OCL standard. He is an active member of the Unified Modeling Language (UML) Revision Task Force, which defined the revisions in the UML 2.0 standard. Previously he was a member of the UML core team, where he was responsible for the development of the Object Constraint Language (OCL). The author of several books and numerous international articles, Jos is an advisor on the UML method and techniques at the De Nederlandsche Bank. Anneke Kleppe is a consultant and adviser at Klasse Objecten, which she founded in 1995 to train and coach companies on the use of object technology, modeling, and MDA. She was intensively involved in the development of the Unified Modeling Language (UML) and the new UML 2.0 standard. The author of several books, Anneke started a knowledge center for object technology at KPN Research in Leidschendam, Netherlands. She is a member of the authoring team of the OCL 2 standard, where she has a special focus on the definition of the semantics of the OCL. 0201379406AB07222003
(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
Erscheint lt. Verlag | 10.12.1998 |
---|---|
Verlagsort | Boston |
Sprache | englisch |
Maße | 187 x 234 mm |
Gewicht | 307 g |
Themenwelt | Mathematik / Informatik ► Informatik ► Programmiersprachen / -werkzeuge |
Informatik ► Software Entwicklung ► Objektorientierung | |
Informatik ► Software Entwicklung ► UML | |
ISBN-10 | 0-201-37940-6 / 0201379406 |
ISBN-13 | 978-0-201-37940-2 / 9780201379402 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich