state machine diagram

28
State Machine Diagram Additional notes: Notes I picked-up on the Internet: University of Toronto, Craig D Wilson (Matincor, Inc.) Chapter 5

Upload: aletta

Post on 23-Feb-2016

52 views

Category:

Documents


0 download

DESCRIPTION

State Machine Diagram. Chapter 5. Additional notes: Notes I picked-up on the Internet: University of Toronto, Craig D Wilson (Matincor, Inc.). Revision: (World View) . Use Case Fully Descriptive Use Case Activity Diagram Domain Model Diagram SSD State Machine Diagram - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: State Machine Diagram

State Machine Diagram

Additional notes: Notes I picked-up on the Internet:• University of Toronto,• Craig D Wilson (Matincor, Inc.)

Chapter 5

Page 2: State Machine Diagram

2

Revision: (World View) Use Case Fully Descriptive Use Case Activity Diagram Domain Model Diagram SSD State Machine Diagram Component Diagrams Deployment Diagrams

Next Semester

Page 3: State Machine Diagram

3

Modeling and role of UML: The model is only useful if the model’s

phenomena correspond in a systematic way to the phenomena of the domain being modeled

Modeling can guide elicitation It can help figure out what questions to ask It can help to surface hidden requirements

Modeling can provide a measure of progress

Page 4: State Machine Diagram

4

Modeling Principle Abstraction:

Strip away detail to concentrate on the relevant or important things

A way of finding similarities between concepts by ignoring irrelevant detail

Iterative development: Frequent build and test Begin with high risk use cases Re

Page 5: State Machine Diagram

5

Advantages of Object Technology: Re-use of components Stability

Interchangeable parts Reliability

Reduced complexity of individual components Integrity

Protected data and code Iterative modeling

Page 6: State Machine Diagram

6

Object Behaviour:

All objects have a “state” An object has a value for each of its attributes Each possible assignment of values to an attribute

is a STATE.

Page 7: State Machine Diagram

7

Page 8: State Machine Diagram

8

State Charts:

Page 9: State Machine Diagram

9

Invoice States: You usually start with an UNPAID account Some luck guy will pay the FULL amount

outstanding, arriving at a state of fully paid Some like us will pay instalments for a few

months, till we pay-off the debt

Page 10: State Machine Diagram

10

Behavior of Object: How do we MODEL this ‘change of state’?

Identify the states Identify the transitions from state to state There are more……let’s eat the elephant bone by

bone!

Page 11: State Machine Diagram

11

Identify all the possible states:

Page 12: State Machine Diagram

12

Page 13: State Machine Diagram

13

Page 14: State Machine Diagram

14

Transitions: A transition consists of THREE parts:

Event, [guard], /action A transition is the movement from one state

to another States are either “on” or “off” at a given point

in time If a state is ON, then transitions are enabled Transitions are triggered by EVENTS

Page 15: State Machine Diagram

15

Event [guard / action A guard is a Boolean condition that must be

TRUE in order for a transition to “fire” When an event occurs the guard conditions

are checked, and if they are met, then the transition FIRES.

An action is a procedural expression to be performed when the transition fires

Page 16: State Machine Diagram

16

Page 17: State Machine Diagram

17

Identify ALL StatesState Transition/event State

Page 18: State Machine Diagram

18

StatesState Transition/event StateSpace available Add student Full

Full Close Enrollment Final,Arhive

Space available Remove student Space available

Page 19: State Machine Diagram

19

Page 20: State Machine Diagram

20

Super States A state can be nested:

A super state consists of more than one state A super state make it possible to view a state

diagram at different levels of abstraction

Page 21: State Machine Diagram

21

“OR” super state When the super state is ON, only one of its

sub states is ON

Page 22: State Machine Diagram

22

“AND” super state “Concurrent sub states”: When the super

state is ON, all of its states are also ON

Page 23: State Machine Diagram

23

Discuss!!

Page 24: State Machine Diagram

24

Exercise

Page 25: State Machine Diagram

25

Video RentalState Transition/Event State

Page 26: State Machine Diagram

26

Summary Object Oriented Analysis and development

provides a way to define and model a system A development methodology combines software

engineering processes and OOAD modeling But…..

There is a steep learning curve. You must be prepared to exercise this method several times before you begin to become proficient!

Page 27: State Machine Diagram

27

Page 28: State Machine Diagram

28

Homework Read: Page 122 – 132 Study: page 129 – 130, Sale Item diagram Page 136, No 7