Agile design of the "copy' example 26 int RdKbd(); void WrtPrt(int); const int EOF =-1; class Reader public:virtual int read()=0; }; class KeyboardReader public Reader public:virtual int read()freturn RdKbd(); hi KeyboardReader GdefaultReader; void Copy(reader&reader =GdefaultReader){ int c; while((c=reader.read())!=EOF) WrtPrt(c); } Institute of Computer Software 2022-2-27 Nanjing University
2022-2-27 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); }
&扇 Agile developers 27 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. Institute of Computer Software 2022-2-27 Nanjing University
2022-2-27 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
&扇 A more complex example: 0o2 UNIVE Multi-panel interactive systems 28 口问题 口简单方案 口结构化的方案 口面向对象的方案 口讨论 Institute of Computer Software 2022-2-228 Nanjing University
A more complex example: Multi-panel interactive systems 问题 简单方案 结构化的方案 面向对象的方案 讨论 2022-2-27 Institute of Computer Software Nanjing University 28 28
Multi-panel interactive systems 29 口问题: ▣业务流程 ■每个会话 (session)须经历多个步骤 口当前步骤 ■显示panel(对话框),获取用户输入(选择),若输 入错,给提示,直至正确;依据输入进行处理并转入下 一步骤(转入哪个步骤可能依赖于用户的输入); 口对话界面 口例如 ■航空订票 Institute of Computer Software 2022-2-229 Nanjing University
Multi-panel interactive systems 问题: 业务流程 每个会话(session)须经历多个步骤 当前步骤 显示panel(对话框),获取用户输入(选择),若输 入错,给提示,直至正确;依据输入进行处理并转入下 一步骤(转入哪个步骤可能依赖于用户的输入); 对话界面 例如 航空订票 2022-2-27 Institute of Computer Software Nanjing University 29 29
Enquiry on Flights- Flight sought from: Santa Barbara To: Paris Departure on or after: 21 Nov On or before: 22 Nov Preferred airline(s): Special requirements: AVAILABLE 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 2022/2/27 Institute of Computer Software Nanjing University