وبلاگ بلیان

Design Patterns Java(TM) Workbook (Software Patterns Series)

معرفی کتاب «Design Patterns Java(TM) Workbook (Software Patterns Series)» نوشتهٔ Steven John Metsker، منتشرشده توسط نشر Addison-Wesley Professional در سال 2002. این کتاب در 4 صفحه، فرمت djvu، زبان انگلیسی ارائه شده است. «Design Patterns Java(TM) Workbook (Software Patterns Series)» در دستهٔ بدون دسته‌بندی قرار دارد.

The intent of the author is good, i.e., providing a workshop for people who are learning GoF design patterns. But result is disappointing. First of all, design pattern would lose most of its values (or at least it is hard to appreciate its value) if there is no design context and forces that constrain or influence the solution proposed by the pattern. The context and resolution of these forces will let the reader/designer the see the value of how a design pattern fits in and balances the forces and maintains a level of flexibility. However, each chapter of the book provides little context for the design challenges. Secondly, I don't understand why the author picks fireworks industry as the background for all the examples in the book, it is an area that most people are not familiar with. I know design patterns are not domain specific and can be applied broadly, but knowing the background of the industry in the examples is definitely helpful for readers. And all those examples are very boring, and sometime ridiculous. Thirdly, the author tries to provide some pattern refactoring examples, but does a lousy job compared with Joshua Kerievsky, the author of "Refactor to Patterns", who provides clear steps to refactor from an existing causal (bad) design to a pattern. Particularly, what are the problems of the existing design and how a design pattern will solve those problems. Overall, I am sorry to say that the author's mission failed terribly for such a good will. Cover......Page 1 Table of Contents......Page 7 Foreword......Page 14 Preface......Page 15 Why Design Patterns?......Page 17 Why Java?......Page 19 Why a Workbook?......Page 20 The Organization of This Book......Page 21 Summary......Page 22 Part I: Interface Patterns......Page 23 Ordinary Interfaces......Page 24 Interfaces and Obligations......Page 25 Placing Constants in Interfaces......Page 26 Beyond Ordinary Interfaces......Page 29 Adapting in the Presence of Foresight......Page 30 Class and Object Adapters......Page 34 Unforeseen Adaptation......Page 40 Recognizing Adapter......Page 41 Summary......Page 42 Refactoring to Facade......Page 44 Facades, Utilities, and Demos......Page 54 Summary......Page 56 An Ordinary Composite......Page 57 Recursive Behavior in Composites......Page 58 Trees in Graph Theory......Page 59 Composites with Cycles......Page 63 Summary......Page 68 A Classic Example of Bridge: Drivers......Page 69 Refactoring to Bridge......Page 73 A Bridge Using the List Interface......Page 76 Summary......Page 77 Part II: Responsibility Patterns......Page 78 Ordinary Responsibility......Page 79 Controlling Responsibility with Visibility......Page 81 Beyond Ordinary Responsibility......Page 83 Singleton Mechanics......Page 85 Singletons and Threads......Page 86 Recognizing Singleton......Page 87 Summary......Page 88 A Classic Example: Observer in Swing......Page 89 Model/ View/ Controller......Page 92 Maintaining an Observable Object......Page 96 Summary......Page 98 A Classic Example: GUI Mediators......Page 100 Relational Integrity Mediators......Page 104 Summary......Page 108 A Classic Example: Image Proxies......Page 109 Image Proxies Reconsidered......Page 114 Remote Proxies......Page 115 Summary......Page 121 Refactoring to Chain of Responsibility......Page 122 Anchoring a Chain......Page 125 Summary......Page 127 Immutability......Page 128 Extracting the Immutable Part of a Flyweight......Page 129 Sharing Flyweights......Page 131 Summary......Page 134 Part III: Construction Patterns......Page 135 Superclass Collaboration......Page 136 Collaboration within a Class......Page 137 Beyond Ordinary Construction......Page 139 Building from a Parser......Page 140 Building under Constraints......Page 141 Summary......Page 144 Recognizing Factory Method......Page 145 A Classic Example of Factory Method: Iterators......Page 146 Taking Control of Which Class to Instantiate......Page 147 Factory Method in Parallel Hierarchies......Page 149 Summary......Page 151 Abstract Factories for Families of Objects......Page 153 Packages and Abstract Factories......Page 156 Abstract Factories for Look- and- Feel......Page 157 Summary......Page 158 Prototypes as Factories......Page 159 Prototyping with Clones......Page 160 Using Object.clone()......Page 162 Summary......Page 166 Applying Memento......Page 167 Persisting Mementos across Sessions......Page 170 Using Strings as Mementos......Page 172 Summary......Page 173 Part IV: Operation Patterns......Page 174 Operations, Methods, and Algorithms......Page 175 The Mechanics of Methods......Page 177 Exceptions in Methods......Page 178 Beyond Ordinary Operations......Page 180 A Classic Example of Template Method: Sorting......Page 182 Completing an Algorithm......Page 184 Template Method Hooks......Page 187 Refactoring to Template Method......Page 188 Summary......Page 190 Modeling States......Page 191 Refactoring to State......Page 194 Making States Constant......Page 198 Summary......Page 199 Modeling Strategies......Page 200 Refactoring to Strategy......Page 202 Comparing Strategy and State......Page 206 Summary......Page 207 A Classic Example: Menu Commands......Page 208 Using Command to Supply a Service......Page 210 Command in Relation to Other Patterns......Page 211 Summary......Page 214 An Interpreter Example......Page 215 Interpreters, Languages, and Parsers......Page 223 Summary......Page 224 Part V: Extension Patterns......Page 226 Reuse as an Alternative to Extension......Page 227 Extending by Subclassing......Page 232 The Liskov Substitution Principle......Page 233 Extending by Delegating......Page 235 Beyond Ordinary Extension......Page 237 A Classic Example of Decorator: Streams......Page 239 Function Decorators......Page 247 Decorating without Decorator......Page 257 Summary......Page 259 Type-Safe Collections......Page 260 Iterating Over a Composite......Page 264 Thread- Safe Iterators......Page 273 Summary......Page 277 Supporting Visitor......Page 278 Extending with Visitor......Page 279 Visitor Cycles......Page 286 Visitor Controversy......Page 289 Summary......Page 290 Part VI: Appendixes......Page 291 Understand the Classics......Page 292 Keep Learning......Page 293 Appendix B. Solutions......Page 295 Introducing Interfaces ( Chapter 2)......Page 297 Adapter ( Chapter 3)......Page 301 Facade ( Chapter 4)......Page 304 Composite ( Chapter 5)......Page 306 Bridge ( Chapter 6)......Page 309 Introducing Responsibility ( Chapter 7)......Page 313 Singleton ( Chapter 8)......Page 315 Observer ( Chapter 9)......Page 317 Mediator ( Chapter 10)......Page 321 Proxy ( Chapter 11)......Page 325 Chain of Responsibility ( Chapter 12)......Page 327 Flyweight ( Chapter 13)......Page 330 Introducing Construction ( Chapter 14)......Page 333 Builder ( Chapter 15)......Page 335 Factory Method ( Chapter 16)......Page 337 Abstract Factory ( Chapter 17)......Page 341 Prototype ( Chapter 18)......Page 345 Memento ( Chapter 19)......Page 348 Introducing Operations ( Chapter 20)......Page 350 Template Method ( Chapter 21)......Page 351 State ( Chapter 22)......Page 353 Strategy ( Chapter 23)......Page 356 Command ( Chapter 24)......Page 358 Interpreter ( Chapter 25)......Page 361 Introducing Extensions ( Chapter 26)......Page 363 Decorator ( Chapter 27)......Page 367 Iterator ( Chapter 28)......Page 370 Visitor ( Chapter 29)......Page 374 Classes......Page 377 Class Relationships......Page 378 Objects......Page 380 States......Page 381 Glossary......Page 383 Bibliography......Page 398

Praise for Design Patterns JavaTM Workbook

“An excellent book... I’m incredibly impressed with how readable it is. I understood every single chapter, and I think any reader with any Java familiarity would. This book is going to be required reading in a lot of places, including my office.”

     —Joshua Engel

“Provides a new, more Java-literate way to understand the 23 GoF patterns.”

     —Bob Hanmer

“This book translates Design Patterns into what Java programmers need to know. It is full of short, engaging programming and design problems with solutions—making it easy for programmers to work through solutions and really make patterns ‘stick.’”

     —Rebecca Wirfs-Brock

“This is one exciting book. It’s approachable, readable, interesting, instructive, and just plain valuable. It’ll eclipse all other books purporting to teach people the GoF patterns in Java—and perhaps any other language.”

     —John Vlissides

Java programmers, you now have the resource you need to harness the considerable power of design patterns. This unique book presents examples, exercises, and challenges that will help you apply design pattern theory to real-world problems. Steve Metsker's learn-by-doing approach helps you enhance your practical skills and build the confidence you need to use design patterns effectively in mission-critical applications.

Design Patterns JavaTM Workbook features the twenty-three foundational design patterns introduced in the classic book Design Patterns (Addison-Wesley, 1995). In this new, hands-on workbook, the patterns are organized into five major categories: interfaces, responsibility, construction, operations, and extensions. Each category begins with a chapter that reviews and challenges your ability to apply facilities built into Java. These introductory sections are followed by chapters that explain a particular pattern in detail, demonstrate the pattern in use with UML diagrams and Java code, and provide programming problems for you to solve.

With this book you will build expertise in important areas such as:

  • Adapting domain data to Swing components
  • Creating a FACADE for Swing
  • Handling recursion in composites
  • Understanding the role of BRIDGE in Java database connectivity
  • Making the connection between Model/View/Controller and OBSERVER
  • Maintaining relational integrity with a mediator
  • Using proxies to communicate between computers
  • Letting a service provider decide which class to instantiate
  • Supporting undo operations with MEMENTO
  • Prototyping with clones
  • Using COMMAND to supply a service
  • Developing thread-safe iterators
  • Extending classes with DECORATOR and VISITOR

Solutions to the design pattern challenges appear in the back of the book, so you can compare your own work to expert approaches. A brief guide to UML explains the modeling notation, and an accompanying Web site provides all the code examples from the book.

Through the instruction and exercises offered in Design Patterns JavaTM Workbook , you can fully understand the role of design patterns in Java application development, and enhance your ability to put design patterns to work.

Praise for Design Patterns Java Workbook "An excellent book... I'm incredibly impressed with how readable it is. I understood every single chapter, and I think any reader with any Java familiarity would. This book is going to be required reading in a lot of places, including my office." - Joshua Engel "Provides a new, more Java-literate way to understand the 23 GoF patterns." - Bob Hanmer "This book translates Design Patterns into what Java programmers need to know. It is full of short, engaging programming and design problems with solutions - making it easy for programmers to work through solutions and really make patterns 'stick.'" - Rebecca Wirfs-Brock "This is one exciting book. It's approachable, readable, interesting, instructive, and just plain valuable. It'll eclipse all other books purporting to teach people the GoF patterns in Java - and perhaps any other language." - John Vlissides Java programmers, you now have the resource you need to harness the considerable power of design patterns. This unique book presents examples, exercises, and challenges that will help you apply design pattern theory to real-world problems. Steve Metsker's learn-by-doing approach helps you enhance your practical skills and build the confidence you need to use design patterns effectively in mission-critical applications. Design Patterns Java Workbook features the twenty-three foundational design patterns introduced in the classic book Design Patterns (Addison-Wesley, 1995). In this new, hands-on workbook, the patterns are organized into five major categories: interfaces, responsibility, construction, operations, and extensions. Each category begins with a chapter that reviews and challenges your ability to apply facilities built into Java. These introductory sections are followed by chapters that explain a particular pattern in detail, demonstrate the pattern in use with UML diagrams and Java code, and provide programming problems for you to solve. With this book you will build expertise in important areas such as: Adapting domain data to Swing components Creating a FACADE for Swing Handling recursion in composites Understanding the role of BRIDGE in Java database connectivity Making the connection between Model/View/Controller and OBSERVER Maintaining relational integrity with a mediator Using proxies to communicate between computers Letting a service provider decide which class to instantiate Supporting undo operations with MEMENTO Workbook approach deepens your understanding, builds your confidence, and strengthens your skills. Covers all five categories of design pattern intent: interfaces, responsibility, construction, operations, and extensions. This new workbook complements the classic Design Patterns, giving Java developers hands-on experience in transforming pattern concepts into working designs and code. Steven John Metsker presents nearly 90 practical pattern exercises, encompassing all 23 patterns first introduced in Design Patterns, and others that have since been identified. Metsker organizes Java design patterns by five categories of "intent": interfaces, responsibility, construction, operations, and extensions. Each section of the book focuses on one category, identifying the relevant challenges facing Java developers, and showing how specific patterns can be used to solve problems that recur in Java development and cannot easily be solved without their use. A Solutions chapter provides Metsker's detailed solutions to each problem, including -- where necessary -- UML diagrams. For all Java developers who want to use patterns to impro ve their software. Includes CDROM This workbook approach deepens understanding, builds confidence, and strengthens readersU skills. It covers all five categories of design pattern intent: interfaces, responsibility, construction, operations, and extensions.
دانلود کتاب Design Patterns Java(TM) Workbook (Software Patterns Series)