没有合适的资源?快使用搜索试试~ 我知道了~
Design_Patterns_Explained
5星 · 超过95%的资源 需积分: 10 16 下载量 23 浏览量
2011-11-10
09:45:35
上传
评论
收藏 4.96MB PDF 举报
温馨提示
试读
398页
Design_Patterns_Explained_A_New_Perspective_on_Object_Oriented_Design_2nd_Edition
资源推荐
资源详情
资源评论
Design Patterns Explained A
New Perspective on
Object-Oriented Design
Second Edition @Team LiB
Design Patterns Explained A New Perspective on Object-Oriented Design Second Edition @Team LiB
1
Table Of Contents
Design Patterns Explained A New Perspective on Object-Oriented Design Second Edition...............8
Table of Contents ..................................................................................................................9
Copyright ........................................................................................................................... 15
Praise for Design Patterns Explained, Second Edition: .............................................................. 16
The Software Patterns Series ................................................................................................ 17
Titles in the series: ....................................................................................................... 17
Preface .............................................................................................................................. 18
From Object Orientation to Patterns to True Object Orientation......................................... 20
From Artificial Intelligence to Patterns to True Object Orientation ...................................... 25
A Note About Conventions Used in This Book .................................................................. 26
Feedback .................................................................................................................... 29
New in the Second Edition............................................................................................. 30
Acknowledgments ........................................................................................................ 30
Part I. An Introduction to Object-Oriented Software Development ............................................ 32
Chapter 1. The Object-Oriented Paradigm ....................................................................... 33
Overview ............................................................................................................. 33
Before the Object-Oriented Paradigm: Functional Decomposition ............................... 33
The Problem of Requirements ................................................................................ 35
Dealing with Changes: Using Functional Decomposition ............................................. 37
Dealing with Changing Requirements....................................................................... 39
The Object-Oriented Paradigm ................................................................................ 43
Object-Oriented Programming in Action................................................................... 51
Special Object Methods ......................................................................................... 54
Summary ............................................................................................................. 55
Review Questions.................................................................................................. 57
Chapter 2. The UMLThe Unified Modeling Language ......................................................... 58
Overview ............................................................................................................. 58
What Is the UML? ................................................................................................. 59
Why Use the UML?................................................................................................ 60
The Class Diagram ................................................................................................. 61
Interaction Diagrams ............................................................................................. 68
Summary ............................................................................................................. 70
Review Questions.................................................................................................. 71
Part II. The Limitations of Traditional Object-Oriented Design.................................................... 72
Chapter 3. A Problem That Cries Out for Flexible Code ...................................................... 73
Overview ............................................................................................................. 73
Extracting Information from a CAD/CAM System ....................................................... 73
Understand the Vocabulary .................................................................................... 74
Describe the Problem ............................................................................................ 76
The Essential Challenges and Approaches................................................................. 78
Summary ............................................................................................................. 82
Design Patterns Explained A New Perspective on Object-Oriented Design Second Edition @Team LiB
2
Review Questions.................................................................................................. 82
Chapter 4. A Standard Object-Oriented Solution .............................................................. 83
Overview ............................................................................................................. 83
Solving with Special Cases ...................................................................................... 84
Summary ............................................................................................................. 92
Review Questions.................................................................................................. 92
Part III. Design Patterns ........................................................................................................ 93
Chapter 5. An Introduction to Design Patterns ................................................................. 95
Overview ............................................................................................................. 95
Design Patterns Arose from Architecture and Anthropology ....................................... 96
Moving from Architectural to Software Design Patterns ........................................... 100
Why Study Design Patterns? ................................................................................. 102
Other Advantages of Studying Design Patterns ........................................................ 107
Summary ........................................................................................................... 108
Review Questions................................................................................................ 109
Chapter 6. The Facade Pattern ..................................................................................... 110
Overview ........................................................................................................... 110
Introducing the Facade Pattern ............................................................................. 110
Learning the Facade Pattern ................................................................................. 110
Field Notes: The Facade Pattern ............................................................................ 113
Relating the Facade Pattern to the CAD/CAM Problem............................................. 115
Summary ........................................................................................................... 115
Review Questions................................................................................................ 116
Chapter 7. The Adapter Pattern.................................................................................... 117
Overview ........................................................................................................... 117
Introducing the Adapter Pattern............................................................................ 117
Learning the Adapter Pattern................................................................................ 118
Field Notes: The Adapter Pattern .......................................................................... 123
Relating the Adapter Pattern to the CAD/CAM Problem ........................................... 127
Summary ........................................................................................................... 127
Review Questions................................................................................................ 127
Chapter 8. Expanding Our Horizons .............................................................................. 129
Overview ........................................................................................................... 129
Objects: The Traditional View and the New View .................................................... 130
Encapsulation: The Traditional View and the New View ........................................... 132
Find What Is Varying and Encapsulate It ................................................................. 135
Commonality and Variability Analysis and Abstract Classes ....................................... 139
The Qualities of Agile Coding ................................................................................ 142
Summary ........................................................................................................... 146
Review Questions................................................................................................ 147
Chapter 9. The Strategy Pattern ................................................................................... 148
Overview ........................................................................................................... 148
An Approach to Handling New Requirements ......................................................... 149
The International E-Commerce System Case Study: Initial Requirements .................... 151
Design Patterns Explained A New Perspective on Object-Oriented Design Second Edition @Team LiB
3
Handling New Requirements ................................................................................ 152
The Strategy Pattern ............................................................................................ 160
Field Notes: Using the Strategy Pattern .................................................................. 162
Summary ........................................................................................................... 164
Review Questions................................................................................................ 165
Chapter 10. The Bridge Pattern .................................................................................... 165
Overview ........................................................................................................... 165
Introducing the Bridge Pattern .............................................................................. 166
Learning the Bridge Pattern: An Example................................................................ 167
An Observation About Using Design Patterns .......................................................... 178
Learning the Bridge Pattern: Deriving It.................................................................. 179
The Bridge Pattern in Retrospect ........................................................................... 188
Field Notes: Using the Bridge Pattern..................................................................... 188
Summary ........................................................................................................... 193
Review Questions................................................................................................ 195
Chapter 11. The Abstract Factory Pattern ...................................................................... 196
Overview ........................................................................................................... 196
Introducing the Abstract Factory Pattern ................................................................ 196
Learning the Abstract Factory Pattern: An Example.................................................. 197
Learning the Abstract Factory Pattern: Implementing It............................................ 204
Field Notes: The Abstract Factory Pattern............................................................... 209
Relating the Abstract Factory Pattern to the CAD/CAM Problem ............................... 213
Summary ........................................................................................................... 213
Review Questions................................................................................................ 214
Part IV. Putting It All Together: Thinking in Patterns ............................................................... 215
Chapter 12. How Do Experts Design? ............................................................................ 215
Overview ........................................................................................................... 215
Building by Adding Distinctions ............................................................................. 216
Summary ........................................................................................................... 223
Review Questions................................................................................................ 223
Chapter 13. Solving the CAD/CAM Problem with Patterns ............................................... 224
Overview ........................................................................................................... 224
Review of the CAD/CAM Problem.......................................................................... 225
Thinking in Patterns ............................................................................................. 226
Thinking in Patterns: Step 1 .................................................................................. 228
Thinking in Patterns: Step 2a ................................................................................ 228
Thinking in Patterns: Step 2b ................................................................................ 233
Thinking in Patterns: Step 2c................................................................................. 238
Thinking in Patterns: Steps 2a and 2b Repeated (Facade).......................................... 239
Thinking in Patterns: Steps 2a and 2b Repeated (Adapter) ........................................ 240
Thinking in Patterns: Steps 2a and 2b Repeated (Abstract Factory) ............................ 240
Thinking in Patterns: Step 3 .................................................................................. 240
Comparison with the Previous Solution.................................................................. 241
Summary ........................................................................................................... 243
Design Patterns Explained A New Perspective on Object-Oriented Design Second Edition @Team LiB
4
Review Questions................................................................................................ 243
Part V. Toward a New Paradigm of Design ............................................................................. 244
Chapter 14. The Principles and Strategies of Design Patterns ........................................... 245
Overview ........................................................................................................... 245
The Open-Closed Principle ................................................................................... 246
The Principle of Designing from Context................................................................. 247
The Principle of Encapsulating Variation ................................................................. 252
Abstract Classes vs. Interfaces............................................................................... 254
The Principle of Healthy Skepticism ....................................................................... 255
Summary ........................................................................................................... 256
Review Questions................................................................................................ 257
Chapter 15. Commonality and Variability Analysis .......................................................... 258
Overview ........................................................................................................... 258
Commonality and Variability Analysis and Application Design ................................... 258
Solving the CAD/CAM Problem with CVA................................................................ 259
Summary ........................................................................................................... 265
Review Questions................................................................................................ 265
Chapter 16. The Analysis Matrix ................................................................................... 265
Overview ........................................................................................................... 266
In the Real World: Variations ................................................................................ 266
The International E-Commerce System Case Study: Handling Variation ...................... 267
Field Notes ......................................................................................................... 276
Summary ........................................................................................................... 280
Review Questions................................................................................................ 280
Chapter 17. The Decorator Pattern ............................................................................... 281
Overview ........................................................................................................... 281
A Little More Detail ............................................................................................. 281
The Decorator Pattern ......................................................................................... 284
Applying the Decorator Pattern to the Case Study ................................................... 285
Another Example: Input/Output............................................................................ 289
Field Notes: Using the Decorator Pattern ............................................................... 291
The Essence of the Decorator Pattern .................................................................... 292
Summary ........................................................................................................... 293
Review Questions................................................................................................ 294
Part VI. Other Values of Patterns ......................................................................................... 294
Chapter 18. The Observer Pattern ................................................................................ 295
Overview ........................................................................................................... 295
Categories of Patterns.......................................................................................... 295
More Requirements for the International E-Commerce Case Study............................ 297
The Observer Pattern........................................................................................... 298
Applying the Observer to the Case Study................................................................ 299
Field Notes: Using the Observer Pattern................................................................. 305
Summary ........................................................................................................... 307
Review Questions................................................................................................ 308
剩余397页未读,继续阅读
资源评论
- haoxirui1112012-10-18TCP/IP详解卷1:协议
- Gauchyler2012-11-28基于模式的程序设计非常好!谢谢!
daisybear
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功