+ All Categories
Home > Documents > 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

Date post: 02-Jan-2016
Category:
Upload: amelia-moore
View: 215 times
Download: 2 times
Share this document with a friend
Popular Tags:
17
1 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling http://www.uic.edu.hk/~kentsang/SWE/SWE.htm
Transcript
Page 1: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

11

Software EngineeringDr. K. T. Tsang

Lecture 9

Advance State Modelinghttp://www.uic.edu.hk/~kentsang/SWE/SWE.htm

Page 2: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

2

Sub-state diagram & submachine

• Complex state diagram can be simplified by using a high-level diagram with sub-diagrams expanding certain states.

• A submachine is a state diagram that may be invoked as part of another state diagram.

• The UML notation for a submachine is a state name followed by a colon and the submachine name.

Page 3: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

3

Example: submachine

Fig.6.2 p.111 B&R

Page 4: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

4

Example: submachine -2

Fig.6.3 p.112 B&R

Page 5: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

5

Nested states• States with common features and shared

behaviors can be grouped together to form a macro-state. This will help to simplify the original complex state diagram.

• The constituent states of the macro-state is called nested states.

Page 6: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

6

State diagrams for a phone line

Fig.5.8 p.97

(no nested states)

Page 7: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

7

Fig.6.4 p.113

State diagrams for a phone line

(with nested states)

Page 8: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

8

Signal (class) generalization

• Signals can be organized into a hierarchy in inheritance relationship.

Hierarchy for keyboard signals -- Fig. 6.6 p.115

Page 9: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

9

Hierarchy for keyboard signals -- Fig. 6.6 p.115

Page 10: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

10

Concurrency

• In general, objects are autonomous entities that can act & change state independently.

• Sometimes, they need not be completely independent and may subject to shared constraints that cause some correspondence among their state changes.

Page 11: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

11

Aggregation concurrencyExample: Car – fig.6.7 p.116

• State diagram for aggregate object is a collection for its parts.

• The aggregate state comprises of (“and” related) one state from each part.

• Transition in one part may depend on the states in other parts.

In the car example, the transition of ignition from “off” to “starting” depends on the transmission in “neutral” state.

Page 12: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

12

Example: Car – fig.6.7 p.116

Page 13: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

13

Concurrent activities within an object

• Some object may have to perform 2 or more activities concurrently.

• These activities may not be synchronized but they must be completed before the object can progress to its next state.

Fig. 6.9 p.117 CashDispenser example

Page 14: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

14

Fig. 6.9 p.117 CashDispenser example

Page 15: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

15

Summary – OO modeling methodologies

• Class model (static view of classes)

– Classes & Associations – Class diagram, Object diagram

• State model (dynamic view of a class, life of objects)

– States, events, signals, activities, & transitions– State diagram

• Interaction model (dynamic view across classes)

– Sequence diagram (time)– Collaboration diagram (players)– Activity diagram (processes)

Page 16: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

16

Development stages

• Requirement

• Analysis

• Design – System (architecture)– Class

• Implementation

• Testing

• Deployment, maintenance

OO Methodologies

Page 17: 11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling kentsang/SWE/SWE.htm.

17

Reading for this lecture

• Chapter 6 Blaha & Rumbaugh


Recommended