Encapsulation of internal states using entry and exit

This preview shows page 104 - 107 out of 182 pages.

Encapsulation of internal states using entry and exit points UML 2 defines entry points and exit points as an extension of state- charts that allow for additional hierarchization of states. An exit point is an externally visible pseudo-state that is immediately associated with an internal state. An exit point is an externally visible pseudo-state that has its origin in an internal state. A super state within a state machine can have arbitrarily many entry and exit points that can be identified by a name [Rumbaugh et al. 2005]. Figure 6-18 shows a state diagram of UML that possesses two explic- itly defined entry points (“enter new destination” and “last destination”) as well as one exit point (“navigation successful”) along with the modeling elements introduced in section 6.7.1. Automaton 1 Automaton 2
Image of page 104

Subscribe to view the full document.

86 6 Model-Based Requirements Documentation Figure 6-18 State diagram in UML 2 notation The state diagram in figure 6-18 documents the reactive behavior of a nav- igation device. Initially, the system is in the state “device ready”. By select- ing “navigate to…”, the system changes into the super state “navigation active” and, within the super state, into the sub state “enter destination data” by making use of the entry point “enter new destination”. Alterna- tively, the system changes from the state “device ready” into the internal state “route calculation” of the super state “navigation active” by making use of the entry point “last destination” as soon as the event “navigate to last destination” occurs. Once the system is in the state “navigation active: enter destination data”, the system transitions into the state “navigation active: route calculation” if the condition that the destination data is valid has been met. Once the route is calculated in the state “navigation active: route cal- culation”, the system transitions into the state “navigation active: output route”. If a deviation from the route is detected (event: “deviation from cal- culated route”) in the state “navigation active: route calculation”, the driver is notified (activity: “notify driver”). From the state “navigation active”, the system transitions into the state “device ready” once the event “cancel” occurs. If the system is in the state “navigation active: route calculation” and the destination is reached, the system exits the super state “navigation active” via the exit point “navigation successful” to transition into the state “device ready”. Route calculation Output route Enter destination data Navigation active Device ready Selected ³QDYLJDWH#WR«´ 6HOHFWHG#³FDQFHO³ Last destination Arrive at destination Destination data entered [destination data valid] Route calculated 6HOHFWHG#³QDYLJDWH#WR#ODVW# GHVWLQDWLRQ³ Deviation from calculated route /notify driver Enter new destination Navigation successful
Image of page 105
6.8 Summary 87 6.8 Summary Along with using natural language to document requirements, require- ments can be documented by means of models. Typically, natural language
Image of page 106

Subscribe to view the full document.

Image of page 107

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

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes