正在加载图片...
20 Design pattern:multi-panel interactive systems oufirstxampe e will devise adesign patte which,inaddition tolusanom typical properties of the object-oriented method,provides an excellent opportunity to contrast it with other approaches,in particular top-down functional decomposition. Because this example nicely captures on a small scale some of the principal properties of object-oriented software construction,I have often used it when requested to introduce an audience to the method in a few hours.By showing concretely (even to people who have had very little theoretical preparation)how one can proceed from a classical decomposition to an O-0 view of things,and the benefits gained in this transformation,it serves as a remarkable pedagogical device.This chapter has been written so that it could play the same role for readers who have been directed to it by the reference they found in the "spoiler"chapter at the beginning of this book. To facilitate their task,it has been made as self-contained as possible;this is why you will find a few repetitions with previous chapters,in particular a few short definitions of concepts which you already know inside out if you have been reading this book sequentially and carefully from the start. 20.1 MULTI-PANEL SYSTEMS The problem is to write a system covering a general type of interactive system,common in business data processing,in which users are guided at each step of a session by a full- screen panel,with predefined transitions between the available panels. The general pattern is simple and well defined.Each session goes through a certain number of states.In each state,a certain panel is displayed,showing questions to the user. The user will fill in the required answer;this answer will be checked for consistency (and questions asked again until an acceptable answer is found);then the answer will be processed in some fashion;for example the system will update a database.A part of the user's answer will be a choice for the next step to perform,which the system will interpret as a transition to another state,where the same process will be applied again A typical example would be an airline reservation system,where the states might represent such steps of the processing as User Identification,Enquiry on Flights(for a certain itinerary on a certain date),Enquiry on Seats(for a certain flight)and Reservation20 Design pattern: multi-panel interactive systems In our first example we will devise a design pattern which, in addition to illustrating some typical properties of the object-oriented method, provides an excellent opportunity to contrast it with other approaches, in particular top-down functional decomposition. Because this example nicely captures on a small scale some of the principal properties of object-oriented software construction, I have often used it when requested to introduce an audience to the method in a few hours. By showing concretely (even to people who have had very little theoretical preparation) how one can proceed from a classical decomposition to an O-O view of things, and the benefits gained in this transformation, it serves as a remarkable pedagogical device. This chapter has been written so that it could play the same role for readers who have been directed to it by the reference they found in the “spoiler” chapter at the beginning of this book. To facilitate their task, it has been made as self-contained as possible; this is why you will find a few repetitions with previous chapters, in particular a few short definitions of concepts which you already know inside out if you have been reading this book sequentially and carefully from the start. 20.1 MULTI-PANEL SYSTEMS The problem is to write a system covering a general type of interactive system, common in business data processing, in which users are guided at each step of a session by a full￾screen panel, with predefined transitions between the available panels. The general pattern is simple and well defined. Each session goes through a certain number of states. In each state, a certain panel is displayed, showing questions to the user. The user will fill in the required answer; this answer will be checked for consistency (and questions asked again until an acceptable answer is found); then the answer will be processed in some fashion; for example the system will update a database. A part of the user’s answer will be a choice for the next step to perform, which the system will interpret as a transition to another state, where the same process will be applied again. A typical example would be an airline reservation system, where the states might represent such steps of the processing as User Identification, Enquiry on Flights (for a certain itinerary on a certain date), Enquiry on Seats (for a certain flight) and Reservation
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有