Download presentation
Presentation is loading. Please wait.
Published byΕυτρόπιος Ταμτάκος Modified over 5 years ago
1
CS551 Behavior Models: Object Types and Operations (Chap. 3 of UML)
Yugi Lee STB #555 (816) CS551 - Lecture 6-2
2
Subtypes 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. CS551 - Lecture 6-2
3
Classes & Types CS551 - Lecture 6-2
4
Type Expression Subtype: Multiple Supertypes Type Exclusion
Cow Mammal Multiple Supertypes Bat Mammal * Flier Type Exclusion TA1 * TA2 = Type Partitioning: TA = TA1+TA2 CS551 - Lecture 6-2
5
State 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. CS551 - Lecture 6-2
6
State 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 CS551 - Lecture 6-2
7
CS551 - Lecture 6-2
8
State Transitions as Actions
CS551 - Lecture 6-2
9
Translating State Transitions to Actions
action Type::a1 pre: s1 & precond post: s2 & postcond action Pump::hangup pre: ready post: idle action Pump::pickup pre: idle post: ready CS551 - Lecture 6-2
10
State Charts of Specification Types
CS551 - Lecture 6-2
11
State Charts of Specification Types
action Drawing_Editor::select (shape:Shape) post: current_doc_contents -> forAll ( s | ((s.selected & ==> s.unselected) & ((s.unselected & ==> s.selected)) CS551 - Lecture 6-2
12
Sequence Expression S1 ; S2 S1 always precedes S2 S1 | S2 S1 or S2
Any number of repetitions of S1 S1 || S2 S1 concurrent with S2 CS551 - Lecture 6-2
13
The Meaning of Containment
Containment represents a localized view, which is a state type of the common usage. CS551 - Lecture 6-2
14
Type Specifications: Summary
An object’s 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. CS551 - Lecture 6-2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.