Homework 4 - Statechart Diagrams

The front door of Brahegatan 4 has a combined code lock and telephone, Figure 1, that works in the following way:

  • To unlock the door, press 'C' and enter the correct 4-key code. The door is unlocked for a few seconds, during which pressed keys are ignored. If the code is not entered within a certain time the lock is reseted.
  • To phone an apartment, enter the correct 4-key apartment number and then press 'C'. The phonecall ends when either the lock phone user press 'R' or the apartment user ends the call. During a phonecall, pressed keys are also ignored. If the number is not entered within a certain time the lock is reseted.
  • An incorrect code or a nonexisting apartment number is ignored.


    Figure 1 The code lock and telephone

    The usage requirements is specified in the use cases in Figure 2 below, and the use case diagram in Figure 3 (the code lock and telephone is named LP).


    Figure 2 Use cases


    Figure 3 Use case diagram

    Assignment

    Define a class to represent the lock (you do not have to define any class diagram). One class is all that is needed. Define public operations (you do not have to model parameters and types). Since the class has a rather complicated internal behavior with different states we will describe its behavior with a statechart diagram.

    Construct a statechart diagram, connected to the class, that describes the behaviour of the lock and phone. Each state should be named, and contain a short description (written in the documentation part of its specification). The transitions should be named according to the events they represent, and marked with appropriate actions and guards.

    Reporting the assignments (deadline 2002-02-19, 12.00)

    Send the file to your lab assistant, following the naming conventions described on the main lab homepage.

    Statechart Diagrams in Rational Rose

    Hints and FAQ