Pattern Framework 模式&框架 Institute of Computer Software 2022-2-27 Nanjing University
模式&框架 Pattern & Framework 2022-2-27 Institute of Computer Software Nanjing University 1
&雪扇 摘要 1002 UNIVE 2 口More about Pattern Framework Comparison Institute of Computer Software 2022-2-27 Nanjing University
摘要 More about Pattern Framework Comparison 2022-2-27 Institute of Computer Software Nanjing University 2
&雪扇 摘要 UNIVE 3 More about Pattern Framework Comparison Institute of Computer Software 2022-2-27 Nanjing University
摘要 More about Pattern Framework Comparison 2022-2-27 Institute of Computer Software Nanjing University 3
&雪扇 More about Pattern 0o2 UNIVE 4 Patterns of Patterns Anti-pattern J2EE patterns Institute of Computer Software 2022-2-27 Nanjing University
More about Pattern Patterns of Patterns Anti-pattern J2EE patterns 2022-2-27 Institute of Computer Software Nanjing University 4
&雪扇 More about Pattern 0o2 UNIVE 5 Patterns of Patterns Anti-pattern J2EE patterns Institute of Computer Software 2022-2-27 Nanjing University
More about Pattern Patterns of Patterns Anti-pattern J2EE patterns 2022-2-27 Institute of Computer Software Nanjing University 5
&扇 NAN Working together 1902 6 Patterns are often used together and combined with the same design solution. A compound pattern combines two or more patterns into a solution that solves a recurring or general problem. Institute of Computer Software 2022-2-27 Nanjing University
Working together Patterns are often used together and combined with the same design solution. A compound pattern combines two or more patterns into a solution that solves a recurring or general problem. 2022-2-27 Institute of Computer Software Nanjing University 6
&扇 Example:设计一个文档编辑器 设计问题 ▣文档结构 ▣格式化 口修饰用户界面 口支持多种视感(look-and-feel)标准 口支持多种窗口系统 口用户操作 口拼写检查和连字符 Institute of Computer Software 2022-2-27 Nanjing University
Example:设计一个文档编辑器 设计问题 文档结构 格式化 修饰用户界面 支持多种视感(look-and-feel)标准 支持多种窗口系统 用户操作 拼写检查和连字符 2022-2-27 Institute of Computer Software Nanjing University 7
使用设计模式 1902 8 Composite表示文档的物理结构:递归组合 Strategy允许不同的格式化算法 口Decorator修饰用户界面 口Abstract Factory支持多视感标准 口Bridge允许多个窗口平台 口Command支持撤销用户操作 口Iterator访问和遍历对象结构 ▣Visitor允许无限扩充分析能力而又不会使文档结 构的实现复杂化 Institute of Computer Software 2022-2-27 Nanjing University
使用设计模式 Composite表示文档的物理结构:递归组合 Strategy允许不同的格式化算法 Decorator修饰用户界面 Abstract Factory支持多视感标准 Bridge允许多个窗口平台 Command支持撤销用户操作 Iterator访问和遍历对象结构 Visitor允许无限扩充分析能力而又不会使文档结 构的实现复杂化 2022-2-27 Institute of Computer Software Nanjing University 8
Duck Example 102 9 Start with a bunch of Quackables.. ▣/ A goose came along and wanted to act like a Quakable too. Adapter Then,the Quackologists decided they wanted to count quacks. Decorator Abstract factory But the Quackologists were worried they'd forget to add the QuackCounter decorator. 口 We had management problems keeping track of all those ducks and geese and quackables. Composite Iterator The Quackologists also wanted to be notified when any quackable quacked. Observer Institute of Computer Software 2022-2-27 Nanjing University
Duck Example Start with a bunch of Quackables.. A goose came along and wanted to act like a Quakable too. Then, the Quackologists decided they wanted to count quacks. But the Quackologists were worried they’d forget to add the QuackCounter decorator. We had management problems keeping track of all those ducks and geese and quackables. The Quackologists also wanted to be notified when any quackable quacked. 2022-2-27 Institute of Computer Software Nanjing University 9 Adapter Decorator Abstract factory Composite Iterator Observer
&雪扇 Compound Patterns 102 UNIVE 10 ▣MVC a song about MVC by James Dempsey (lyrics) the view display is updated for your actions you you see the song go to the display update and controller hear the new song "Play new song' playing View Controller Model tells the view the state has changed Player model to begin playing the model notifles song the view of a change in state controller manlpulates the model Model The model contains all the state. data,and application logic needed to maintain and play mp3s Institute of Computer Software 2022-2-27 Nanjing University
Compound Patterns MVC a song about MVC by James Dempsey (lyrics) 2022-2-27 Institute of Computer Software Nanjing University 10