最病 Agile design of the"copy example int Rdbd void WrtPrt(int); const int EOF =-1; class Reader public: virtual int read(=0; class Keyboard Reader: public Reade public: virtual int read() freturn Rdkbd( 1 KeyboardReader GdefaultReader; void Copy(reader& reader=GdefaultReaderk int Ci while((c=reader read()= EOF) WrtPrt(c); Institute of Computer Software 2021/2/12 Nanjing University
2021/2/2 Institute of Computer Software Nanjing University 26 Agile design of the “copy” example int RdKbd(); void WrtPrt(int); const int EOF = -1; class Reader{ public: virtual int read() = 0; }; class KeyboardReader : public Reader{ public: virtual int read() {return RdKbd();} }; KeyboardReader GdefaultReader; void Copy(reader& reader = GdefaultReader){ int c; while ((c=reader.read()) != EOF) WrtPrt(c); }
最病 E Agile developers a Knew what to do because n Detect the problem by following agile practices a Diagnose the problem by applying design principles a Solve the problem by applying the appropriate design pattern a The interplay between these three aspects of software development is the act of design. Institute of Computer Software 2021/2/12 Nanjing University
2021/2/2 Institute of Computer Software Nanjing University 27 Agile developers Knew what to do because Detect the problem by following agile practices; Diagnose the problem by applying design principles Solve the problem by applying the appropriate design pattern The interplay between these three aspects of software development is the act of design
M fl a more complex example Multi-panel interactive systems 口问题 口简单方案 口结构化的方案 口面向对象的方案 口讨论 Institute of Computer Software 2021/2/12 Nanjing University
A more complex example: Multi-panel interactive systems 问题 简单方案 结构化的方案 面向对象的方案 讨论 2021/2/2 Institute of Computer Software Nanjing University 28 28
最病 A Multi-panel interactive systems 口问题: 口业务流程 每个会话( session)须经历多个步骤 当前步骤 ■显示 panel(对话框),获取用户输入(选择),若输 入错,给提示,直至正确;依据输入进行处理并转入下 一步骤(转入哪个步骤可能依赖于用户的输入) 口对话界面 口例如 ■航空订票 Institute of Computer Software 2021/2/12 Nanjing University
Multi-panel interactive systems 问题: 业务流程 ◼ 每个会话(session)须经历多个步骤 当前步骤 ◼ 显示panel(对话框),获取用户输入(选择),若输 入错,给提示,直至正确;依据输入进行处理并转入下 一步骤(转入哪个步骤可能依赖于用户的输入); 对话界面 例如 ◼ 航空订票 2021/2/2 Institute of Computer Software Nanjing University 29 29
Enquiry on Flights Flight sought from: Santa Barbara To: Paris Departure on or after: 21 N01 On or before:I 22 Nov Preferred airline(s) Special requirements AⅤ AILABLE FLIGHTS:1 FIt# AA 42 Dep 8: 25 Arr 7: 45 Thru: Chicago Choose next action 0—Exit 1—Help 2— Further enquiry 30 3— Reserve a seat
Institute of Computer Software Nanjing University 30 2021/2/2 Institute of Computer Software Nanjing University