Page 205 -
P. 205

188   Chapter 7   Design and implementation



                                                             Controlled



                                                     Operation
                                         shutdown( )             remoteControl( )


                                                restart( )              reportStatus( )
                                   Shutdown                  Running                    Testing
                                                                        transmission done
                            reconfigure( )   configuration done                              test complete
                            powerSave( )
                                                          clock  collection
                                                                 done                 Transmitting

                                  Configuring                 Collecting      reportWeather( )
                                                                                           weather
                                                                                           summary
                                                                                           complete
                                                                        Summarizing





                                    4.  If a reportStatus() message is received, the system moves to the Testing state,
                   Figure 7.8 Weather
                   station state diagram  then the Transmitting state, before returning to the Running state.
                                    5.  If a signal from the clock is received, the system moves to the Collecting state,
                                        where it collects data from the instruments. Each instrument is instructed in turn
                                        to collect its data from the associated sensors.
                                    6.  If a remoteControl() message is received, the system moves to a controlled state
                                        in which it responds to a different set of messages from the remote control
                                        room. These are not shown on this diagram.


                                       State diagrams are useful high-level models of a system or an object’s operation.
                                    You don’t usually need a state diagram for all of the objects in the system. Many of
                                    the objects in a system are relatively simple and a state model adds unnecessary
                                    detail to the design.


                              7.1.5 Interface specification

                                    An important part of any design process is the specification of the interfaces between
                                    the components in the design. You need to specify interfaces so that objects and sub-
                                    systems can be designed in parallel. Once an interface has been specified, the devel-
                                    opers of other objects may assume that interface will be implemented.
                                       Interface design is concerned with specifying the detail of the interface to an
                                    object or to a group of objects. This means defining the signatures and semantics of
   200   201   202   203   204   205   206   207   208   209   210