engineering quality software. today o state diagrams jerry kotuba syst30009-engineering quality...

24
Lesson10 Engineering Quality Software

Upload: bruce-anthony

Post on 19-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Lesson10Engineering Quality Software

Page 2: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Agenda Today

o State Diagrams

Jerry KotubaSYST30009-Engineering Quality

Software2

Page 3: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

The Big Picture

Jerry Kotuba Object Oriented Methods 3

Page 4: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Learning outcomes Learn how to construct a state chart of an object. Learn how to discover operations (behaviors) for

the classes we found by studying object life cycles.

Jerry Kotuba Object Oriented Methods 4

Page 5: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Focus so far… Objects within the business domain (i.e., the

context diagram)o Entity objects

Other objectso Interface objects…user access to the systemo Control objects…application or business rule logic

Jerry Kotuba Object Oriented Methods 5

Page 6: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

State chart Diagrams Models the dynamic aspects of a system as it

moves from state to state

Jerry Kotuba Object Oriented Methods 6

Page 7: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Printer Example -Illustration

Jerry Kotuba Object Oriented Methods 7

Page 8: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Object States and the State chart Diagram

Lifetimes and Life Cycles Events and States Transitions Actions and Activities The Statechart Diagram Object Lifecycles on the Statechart Diagram

Jerry Kotuba Object Oriented Methods 8

Page 9: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Notation for Statechart Diagram

Symbol

Purpose

An object’s current state (status)

Denotes the beginning of state chart flow

Arrow indicates the direction of transition from origin to destination state.

Indicates terminal state of an object.

Transition / name

[Guard] / Action

Transition Label

Page 10: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

System Architect Tools

Jerry Kotuba Object Oriented Methods 10

Page 11: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Substates state diagram exploded into lower levels states can be exploded into substates

Jerry Kotuba Object Oriented Methods 11

Page 12: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Printer Example –Illustration 2

Jerry Kotuba Object Oriented Methods 12

Page 13: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Your turn… SLATE- Week08

o Cell Phone Exercise

Jerry Kotuba Object Oriented Methods 13

Page 14: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Rules for Developing Statecharts

[1] Select the classes that will require statecharts

[2] List all the status conditions for each group

[3] Specify transitions that cause object to leave the identified state

[4] Sequence state-transition combinations in correct order

Jerry Kotuba Object Oriented Methods 14

Page 15: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Rules for Developing Statecharts (continued)

[5] Identify concurrent paths.

[6] Look for additional transitions

[7] Expand each transition as appropriate

[8] Review and test each statechart

Jerry Kotuba Object Oriented Methods 15

Page 16: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Assignment SLATE – Week08

o ICE-06

Jerry Kotuba Object Oriented Methods 16

Page 17: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Other Examples

Jerry Kotuba Object Oriented Methods 17

Page 18: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2
Page 19: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Event

something that happens at a certain point in time

important occurrence that triggers a state transitiono i.e. place an order,

register for class, apply for loan, hire new employee

An event is considered to be instantaneous

Page 20: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Transition

must be named after the event

may include the following:o [guard condition]

• shown in square brackets

o /action expression• action specified

after the / slasho parameters of the

event• i.e. 3 month

timeframe

Page 21: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

State Diagram for Student Registration

Page 22: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Nested State Diagram forMatriculated State of Student Object

Page 23: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

Nested States And Concurrency

Concurrency: condition of being in more than one state at a time

Two modes of representationo Use synchronization bars and concurrent pathso Nest low-level states inside higher-level states

Higher-level states also called composite stateso Complex structure of sets of states and

transitions o Represent a higher level of abstraction

Jerry Kotuba Object Oriented Methods 23

Page 24: Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2

For Next Class Read text What comes next?

o Complete state chartso Begin Sequence Diagrams

Jerry Kotuba Object Oriented Methods 24