正在加载图片...
PA7 PUBLIC ANSWERS TO EXERCISES Chapter 3. Basing software development on reusable technology E3. 1 p. 63 Researching resources on the Internet that discuss aspects of reuse The answer to this question will vary since web pages are continually being added, deleted and changed E3. 2 p 63 Analysing information about reuse. For discussion only 3.3 pp. 69-70 Determining the services that should be present in a framework a)"Reservation framework Add an instance of whatever that can be reserved(e. g. a book, a place on a flight, a seat in a theatre) Add an instance of whatever the reservation is made on behalf of(e.g. a library patron, a passenger,a theatre-goer) Make a reservation · Delete a reservation E3.4 P. 70 Determining differentiating features of framework-based applications, as well as its hooks and slots a)*Reservation framework Differentiating features The classes of objects that can be reserved and their attributes, associations and other operations The attributes of the reservation itself, and perhaps subclasses representing different types of reservation The classes of objects that a reservation can be made on behalf of The user interface Rules regarding the reservation such as who can make one whether the item can be reserved eto · Hooks A function that would be called when a reservation is complete(e.g. to send an email) An function to call when reservations are full that could be used, for example, to add a waiting list, or to give some form of notification to the user A function called to load a reservation from a database a function called to save a reservation There may be no slots in this system E3.5 p. 70 Determining the range of applications that might benefit from a framework. a)*Reservation framework A library system, where you can reserve items that are already checked out Reservation of seats on any kind of transportation system Reservation of entertainment tickets E3.6 p. 70 Evaluating alternative approaches to designing a framework. a) *If you started with a vertical framework for a frequent flier program, you would have a lot of facilities already developed, some of which would be quite specific to the frequent flier domain. The following gives some ideas of the services, slots and hooks that might be provided; many variations on this answer are possible 1. Services Maintenance of frequent flier accounts to which points(miles) can be added and redeemed (i.e adding new accounts; deleting accounts) Keeping of basic personal information(name, address, points)about each frequent flier, with methods to update this information(which would call the first hook below to allow managing of additional information) Keeping of a log of flights to be used when producing reports(would also be capable of recording other transactions, e.g. points awarded for renting a car) Methods to add, delete and query the number of points in the account C 2002 TIMOTHY C. LETHBRIDGE AND ROBERT LAGANIEREPA7 PUBLI C A NSW ERS T O EX E RCISE S © 2002 T IMO TH Y C. LE T HBRI D GEA N D RO BERT L AG AN I ÈRE Chapt er 3. Basi ng sof tw ar e developm enton r eusable technol ogy E 3.1 p. 63 Re se arc hing re sourc e s on the I nternet that disc uss aspe cts of re use . T hea nsw erto this question will va r y sincew e b pa ges a r e continua lly being adde d, de leted and c ha nge d. E 3.2 p. 63 Analy sing information about re use. Fordisc ussion only. E 3.3 pp. 69-70 D eterm ining these rv ice s that should be pre se nt in a frame work. a )*R eser vat ion f ram ew or k. • A dd a n instanc e ofwhate ve r tha t c an ber ese rved (e .g. abook, apla c e on a flight, a se a t in a the atre ) • A dd a n instance of w hateve r the r ese rvation is made on behalf of ( e.g. a libra ry pa tr on, a pa sse nger , a the atr e- goe r) . • Make ar ese rvation • D eleteare se r va tion E 3.4 p. 70 De te rmining diffe re ntiating fe ature s of fram ework -base d applications, as well as its hook s and slots. a )*R eser vat ion f ram ew or k. • D if fe r entia ting fe ature s: - T hec lasse s of objec ts tha t ca n be r eser ved a nd the ira ttr ibute s, assoc ia tions a nd otheroper ations - T he a ttr ibute s of the r ese rvation itse lf , a nd pe rha ps subc la sse s r epre senting dif fe re nt types of r eser vation - T hec lasse s of objec ts tha t a r eser vation c an bema deon beha lfof - T heuserinte rf a ce - Rules re ga r ding the r eser vation, suc h as who c an ma keone, w hethe rtheitem ca n be re ser ve d, etc . • H ooks: - Af unc tion that would be c alle d w he n ar e se rva tion is c omple te (e .g. to send a n e ma il) - A n function to c all w he n r eser vations ar e‘ full’that c ould be use d, f or exa mple , to a dd awa iting list, or to givesomeform ofnotific ation to theuser . - Af unc tion ca lle d to load a re ser va tion f rom adata ba se . - Af unc tion ca lle d to sa veare se r va tion. • Slots: - T he rema y be no slots in this syste m. E 3.5 p. 70 De te rmining therange of applications that m ight benefit from a frame work. a )*R eser vat ion f ram ew or k. • Alibr ar y syste m, whe reyou ca n r ese rve ite ms that ar e a lr ea dy che cked out • Reser vation of sea ts on a ny kind oftr ansporta tion syste m • Reser vation of e nter tainme nt tickets E 3.6 p. 70 Ev aluating alte rnativeapproac he s to de signing a frame work. a )*I f you sta r te d w ith a ver tic al fr ame work for a f re que nt flie r progra m, you w ould ha ve a lot of f ac ilities a lr ea dy de velope d, some of w hic h would be quite spe cific to the f r eque nt flier doma in. T he following gives some idea s of the se rvic e s, slots a nd hooks tha t might be pr ovide d; ma ny va riations on this answe r a repossible. i. Ser vic es: • Mainte na nc e of f re que nt f lie r a cc ounts to w hic h points (mile s) c a n be adde d a nd re de e me d ( i.e. a dding new ac counts; de le ting a cc ounts) • K ee ping of ba sic per sonal infor ma tion (na me , a ddre ss, points) a bout ea c h fr e quent f lie r, w ith methods to upda te this inf or ma tion ( whic h w ould ca ll the f ir st hook be low to a llow ma naging of a dditional infor ma tion) • K ee ping of a log of f lights to be used w hen pr oduc ing r e ports ( would a lso be c apa ble of re c or ding othertr ansac tions, e .g. points a wa r de d f orr e nting ac a r) . • Methods to add, de le te and que r y thenumberofpoints in theac count
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有