Detail Design Extending UML and Object Design
Object Design
Extending UML
Constraints: Telemarketing Example
Constraints: Contact Management Example
OCL (Object Constraint Language) OCL is a formal language intended for specifying constraints Most OCL statements consist of the following structural elements – context -- defines a domain within which the expression is valid (e.g. an instance of a specific type or class, or a link) – a property of that instance which is the context for the expression -- e.g. attributes, association-ends – an OCL operation which is applied to the property -- arithmetic operators, set operators and type operators OCL statements can also include keywords – e.g. and, or, implies, if, then, else, not, in
Examples of OCL Expressions
Specifying OCL Constraints
Example OCL Operation Specification
Notes and Tags
Notes and Tags: Contact Management Example
Using Notes to Express OCL Constraints
Object-Oriented Detailed Design
Class Specification – Attributes and Operations
Class Specification Example
Attribute and Operation Visibility
Derived Information Derived information is information which is computed from other model elements – a kind of constraint that applies to an attribute or an association – derived information may make the model more readable Knowing which information is derived is more important in the design model – during design, access to information should be optimised -- actual data (derived information is stored after it has been derived) -- virtual data (derived information is dynamically recomputed each time) The UML notation for derived information is a solidus / in front of the name of the derived attribute or association
Derived Attribute Example
Summary Extending UML – additional modelling concepts ● stereotypes ● comments ● constraints – OCL (Object Constraint Language) References – Maciaszek, section 5.11, Bennett et al., section 10.5