Lecture 11 State Diagrams

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

Info icon This 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
Image of page 1

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

View Full Document Right 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
Image of page 2
Copyright W. Howden 3 Sample State Diagram Breakfast InClass Studying Sleeping Dinner Alarm ClassOver DinnerTime DinnerFinished ClassTime NextClassStartTime
Image of page 3

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

View Full Document Right 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?
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
Image of page 5

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

View Full Document Right Arrow Icon
Copyright W. Howden 6 Student Example 2 ClassOver [>=DinnerTime & NoMoreClasses] BreakfastOver Breakfast InClass Studying Sleeping Dinner Alarm ClassOver [<DinnerTime or More Classes] DinnerTime [NoMoreClasses] DinnerFinished ClassTime
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
Image of page 7

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

View Full Document Right 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
Image of page 8
Copyright W. Howden
Image of page 9

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern