7 - OCL Object Constraint Language Official part of UML...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
© 2010 by Spencer Rugaber OCL • O bject C onstraint L anguage • Official part of UML • Strongly typed, declarative specification of system properties • Assertions + collection classes + UML diagram navigation • Supported by Rational Rose, ArgoUML, Eclipse, Poseidon/Octopus, Enterprise Architect
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2010 by Spencer Rugaber Why Do we Need OCL? • UML diagrams, as a graphical language, are limited in what they can express – Structural relationships, behavioral descriptions – The language needs a mechanism for specifying precise semantics • OCL extends UML with – Class invariants – Operation pre and post conditions – Guards on state-machine transitions
Background image of page 2
© 2010 by Spencer Rugaber OCL Overview • Declarative not procedural – Pure expression language – No side effects • Strongly typed – Built-in types plus types (classifiers) introduced in UML diagrams • Highest level mechanism is the constraint – Formal assertion of system properties
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2010 by Spencer Rugaber Uses of OCL • As a query language • To specify invariants on classes in the class model • To describe pre- and post conditions on Operations and Methods • To specify derivation rules for derived attributes • To describe Guards on transitions in State Diagrams • To specify target (sets) for messages and actions • To specify type invariants for Stereotypes
Background image of page 4
© 2010 by Spencer Rugaber Syntax context is a keyword indicating the start of a new constraint • <identifier> is a class or Operation name
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/03/2010 for the course SA 5010 taught by Professor Spen during the Spring '10 term at Asian Institute of Management.

Page1 / 15

7 - OCL Object Constraint Language Official part of UML...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online