Title: CS551 Behavior Models: Object Types and Operations (Chap. 3 of UML)
1CS551 Behavior Models Object Types and
Operations (Chap. 3 of UML)
- Yugi Lee
- STB 555
- (816) 235-5932
- yugi_at_cstp.umkc.edu
- www.cstp.umkc.edu/yugi
2Subtypes and Type Extension
- Class
- an object-oriented programming (OOP) construct
(implementation of some objects) - Type
- a specification of a set of objects
- Subclassing
- inheriting implementation with certain forms of
overriding of implementation - Subtyping
- no overriding of specifications, only extension.
3Classes Types
4Type Expression
- Subtype
- Cow Mammal
- Multiple Supertypes
- Bat Mammal Flier
- Type Exclusion
- TA1 TA2
- Type Partitioning
- TA TA1TA2
5State Type
- A set of objects defined by a predicate
- Objects are classified based on a condition and
define resultant properties they will have - An employee is a person with an employer
employees have a salary and can get fired.
6State Chart
- Each state is a Boolean attribute
- The structure of states defines invariants across
these attributes. - States are
- mutually exclusive.
- can be nested inside a state.
- can be divided into concurrent sections
7(No Transcript)
8State Transitions as Actions
9Translating State Transitions to Actions
action Typea1 pre s1 precond post s2
postcond
- action Pumphangup
- pre ready
- post idle
- action Pumppickup
- pre idle
- post ready
10State Charts of Specification Types
11State Charts of Specification Types
action Drawing_Editorselect (shapeShape) post
current_doc_contents -gt forAll ( s
((s.selected sshape)_at_pre gt
s.unselected) ((s.unselected sshape)_at_pre
gt s.selected))
12Sequence Expression
- S1 S2
- S1 always precedes S2
- S1 S2
- S1 or S2
- S1
- Any number of repetitions
- of S1
- S1 S2
- S1 concurrent with S2
13The Meaning of Containment
Containment represents a localized view, which is
a state type of the common usage.
14Type Specifications Summary
- An objects behavior (or part of it) can be
described with a type specification. - A type specification is a set of action
specifications - A postcondition a relationship between the
states before and after any of its occurrences
takes place. - A precondition when the associated postcondition
is applicable.