正在加载图片...
680 DESIGN CASE STUDY:MULTI-PANEL INTERACTIVE SYSTEMS $20.3 Level3 Top-down execute session functional decomposition execute initial transition state is_final Level2 Level1 display read correct message process Immediately below (level 2)we will find the operations relative to states:definition of the initial and final states,transition structure,and execute state which prescribes the actions to be executed in each state.Then at the lowest level (1)we will find the constituent operations of execute state:display a screen and so on.Note how such a solution may be described,as well as anything object-oriented that we may later see,to "reflect the real world":the structure of the software perfectly mirrors the structure of an application,which involves states,which involve elementary operations.Real- worldliness is not,in this example and many others,a significant difference between O-O and other approaches;what counts is how we model the world. In writing execute session let us try to make it as application-independent as possible.(The routine is again expressed in an ad hoc notation imitated from the O-O notation of the rest of this book.The repeat...until...loop is borrowed from Pascal.) execute session is --Execute a complete session of the interactive system local state,choice:INTEGER do state initial repeat execute state (state,next) --Routine execute state updates the value of next. state :transition (state,next) until is final (state)end end680 DESIGN CASE STUDY: MULTI-PANEL INTERACTIVE SYSTEMS §20.3 Immediately below (level 2) we will find the operations relative to states: definition of the initial and final states, transition structure, and execute_state which prescribes the actions to be executed in each state. Then at the lowest level (1) we will find the constituent operations of execute_state: display a screen and so on. Note how such a solution may be described, as well as anything object-oriented that we may later see, to “reflect the real world”: the structure of the software perfectly mirrors the structure of an application, which involves states, which involve elementary operations. Real￾worldliness is not, in this example and many others, a significant difference between O-O and other approaches; what counts is how we model the world. In writing execute_session let us try to make it as application-independent as possible. (The routine is again expressed in an ad hoc notation imitated from the O-O notation of the rest of this book. The repeat … until … loop is borrowed from Pascal.) execute_session is -- Execute a complete session of the interactive system local state, choice: INTEGER do state := initial repeat execute_state (state, →next) -- Routine execute_state updates the value of next. state := transition (state, next) until is_final (state) end end execute_session initial transition execute_ state is_final display read correct message process Level 1 Level 3 Level 2 Top-down functional decomposition
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有