没有合适的资源?快使用搜索试试~ 我知道了~
首页设计模式(desing pattern)
设计模式是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。<br><br>毫无疑问,设计模式于己于他人于系统都是多赢的,设计模式使代码编制真正工程化,设计模式是软件工程的基石,如同大厦的一块块砖石一样。<br><br>GoF(Gang of Four,指《设计模式-可复用面向对象软件的基础》的四位作者:Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides)的“设计模式”是第一次将设计模式提升到理论高度,并将之规范化,本书提出了23种基本设计模式,自此,在可复用面向对象软件的发展过程中,新的大量的设计模式不断出现。<br>很多专业人士强烈推荐的一本书
资源详情
资源评论
资源推荐

Design Patterns: Elements of Reusable Object-Oriented Software
Design Patterns
Elements of Reusable Object-Oriented Software
1

Design Patterns: Elements of Reusable Object-Oriented Software
Contents
Preface to CD ............................................................... 5
Preface to Book ............................................................. 7
Foreword .................................................................... 9
Guide to Readers ............................................................ 10
1 Introduction .............................................................. 11
1.1 What Is a Design Pattern? ............................................. 12
1.2 Design Patterns in Smalltalk MVC ...................................... 14
1.3 Describing Design Patterns ............................................ 16
1.4 The Catalog of Design Patterns ........................................ 18
1.5 Organizing the Catalog ................................................ 21
1.6 How Design Patterns Solve Design Problems ............................. 23
1.7 How to Select a Design Pattern ........................................ 42
1.8 How to Use a Design Pattern ........................................... 44
2 A Case Study: Designing a Document Editor ................................. 46
2.1 Design Problems ....................................................... 46
2.2 Document Structure .................................................... 47
2.3 Formatting ............................................................ 53
2.4 Embellishing the User Interface ....................................... 56
2.5 Supporting Multiple Look-and-Feel Standards ........................... 60
2.6 Supporting Multiple Window Systems .................................... 64
2.7 User Operations ....................................................... 72
2.8 Spelling Checking and Hyphenation ..................................... 77
2.9 Summary ............................................................... 90
Design Pattern Catalog ...................................................... 93
3 Creational Patterns ....................................................... 94
Abstract Factory .......................................................... 99
Builder ................................................................... 110
Factory Method ............................................................ 121
Prototype ................................................................. 133
Singleton ................................................................. 144
Discussion of Creational Patterns ........................................... 153
2

Design Patterns: Elements of Reusable Object-Oriented Software
4 Structural Patterns ....................................................... 155
Adapter ................................................................... 157
Bridge .................................................................... 171
Composite ................................................................. 183
Decorator ................................................................. 196
Façade .................................................................... 208
Flyweight ................................................................. 218
Proxy ..................................................................... 233
Discussion of Structural Patterns ........................................... 246
5 Behavioral Patterns ....................................................... 249
Chain of Responsibility .................................................... 251
Command ................................................................... 263
Interpreter ............................................................... 274
Iterator .................................................................. 289
Mediator .................................................................. 305
Memento ................................................................... 316
Observer .................................................................. 326
State ..................................................................... 338
Strategy .................................................................. 349
Template Method ........................................................... 360
Visitor ................................................................... 366
Discussion of Behavioral Patterns ........................................... 382
6 Conclusion ................................................................ 388
6.1 What to Expect from Design Patterns ................................... 388
6.2 A Brief History ....................................................... 392
6.3 The Pattern Community ................................................. 393
6.4 An Invitation ......................................................... 395
6.5 A Parting Thought ..................................................... 396
A Glossary .................................................................. 397
B Guide to Notation ......................................................... 404
B.1 Class Diagram ......................................................... 404
B.2 Object Diagram ........................................................ 406
B.3 Interaction Diagram ................................................... 407
C Foundation Classes ........................................................ 409
C.1 List .................................................................. 409
C.2 Iterator .............................................................. 412
C.3 ListIterator .......................................................... 413
3

Design Patterns: Elements of Reusable Object-Oriented Software
C.4 Point ................................................................. 413
C.5 Rect .................................................................. 414
Bibliography ................................................................ 416
4

Design Patterns: Elements of Reusable Object-Oriented Software
Preface to CD
As we were writing Design Patterns, we knew the patterns we were describing had
value because they had proven themselves in many different contexts. Our hope was
that other software engineers would benefit from these patterns as much as we had.
Now, three years after its debut, we find ourselves both grateful and thrilled by
how the book has been received. Lots of people use it. Many tell us the patterns
have helped them design and build better systems. Many others have been inspired to
write their own patterns, and the pool of patterns is growing. And many have
commented on what might be improved about the book and what they would like to see
in the future.
A recurring comment in all the feedback has been how well-suited the book is to
hypertext. There are numerous cross-references, and chasing references is something
a computer can do very well. Since much of the software development process takes
place on computers, it would be natural to have a book like ours as an on-line
resource. Observations like these got us excited about the potential of this medium.
So when Mike Hendrickson approached us about turning the book into a CD-ROM, we
jumped at the chance.
Two years and several megabytes of e-mail later, we're delighted that you can
finally obtain this edition, the Design Patterns CD, and put its unique capabilities
to work. Now you can access a pattern from your computer even when someone has
borrowed your book. You can search the text for key words and phrases. It's also
considerably easier to incorporate parts of it in your own on-line documentation.
And if you travel with a notebook computer, you can keep the book handy without
lugging an extra two pounds of paper.
Hypertext is a relatively new publishing venue, one we are learning to use just like
everyone else. If you have ideas on how to improve this edition, please send them to
design-patterns-cd@cs.uiuc.edu. If you have questions or suggestions concerning the
patterns themselves, send them to the
gang-of-4-patterns@cs.uiuc.edu mailing list.
(To subscribe, send e-mail to
gang-of-4-patterns@cs.uiuc.edu with the subject
"subscribe".) This list has quite a few readers, and many of them can answer
questions as well as we can – and usually a lot faster! Also, be sure to check out
the Patterns Home Page at
http://hillside.net/patterns/. There you'll find other
books and mailing lists on patterns, not to mention conference information and
patterns published on-line.
This CD entailed considerable design and implementation work. We are indebted to
Mike Hendrickson and the team at Addison-Wesley for their on-going encouragement and
support. Jeff Helgesen, Jason Jones, and Daniel Savarese garner many thanks for
5
剩余428页未读,继续阅读


安全验证
文档复制为VIP权益,开通VIP直接复制

评论0