Lecture 11 State Diagrams

Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition)

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright W. Howden 1 Lecture 12: State Chart Models
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Copyright W. Howden 2 State Models • Components – States: a condition of an object – Events: a state changing occurrence – Transitions: from one state to the next, occur when the associated event occurs
Background image of page 2
Copyright W. Howden 3 Sample State Diagram Breakfast InClass Studying Sleeping Dinner Alarm ClassOver DinnerTime DinnerFinished ClassTime NextClassStartTime
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Copyright W. Howden 4 Consistent and Complete • Multiple transitions from a state? – Non-overlapping events (consistency) – Complete set of events • Sample state machine – What if dinner time occurs at the same time as the next class time? – What happens after breakfast if there are no classes? – What happens if dinner time event occurs while in class?
Background image of page 4
Copyright W. Howden 5 Augmented Diagrams • Constraints/guards needed for better model – Condition(s) added to transition(s) – If event occurs, transition takes place only if condition is satisfied • Actions can be added to transitions – Performed if transition takes place • Actions on state entry and state exit also
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Copyright W. Howden 6 Student Example 2 NoMoreClasses] BreakfastOver Breakfast InClass Studying Sleeping Dinner Alarm ClassOver [<DinnerTime or More Classes] DinnerTime [NoMoreClasses] DinnerFinished ClassTime
Background image of page 6
Copyright W. Howden 7 State Model Representations • Graphical: useful for small systems • Tables – State/state or event/state – Better for larger models – Duplicate events and states are obvious – Easier to build up incrementally • State variable modification equations
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Copyright W. Howden 8 State/State Model Table Studying Breakfast In Class Dinner Sleeping State State DinnerOver Dinner ClassTime DinnerTime [NoMoreClasses] Studying Breakfast Over Breakfast ClassOver [<DinnerTime or MoreClasses] ClassOver [>=DinnerTime & NoMoreClasses] In Class Alarm Sleeping
Background image of page 8
Copyright W. Howden
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/11/2008 for the course CSE 111 taught by Professor Howden during the Fall '07 term at UCSD.

Page1 / 29

Lecture 11 State Diagrams - Lecture 12: State Chart Models...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online