Design Patterns Explained: A New Perspective on Object-Oriented Design. Second Edition)
by Alan Shalloway and James R. TrottRelated pagesRelated resourcesBelow is an annotated table of contents, summarizing each part and chapter, showing the topics covered, and listing articles that relate to the chapter. PrefaceThis chapter provides a brief overview of the Unified Modeling Language (UML), the modeling language of the object-oriented community. If you do not already know the UML, this chapter gives you the minimal understanding you need to be able to read the diagrams contained in this book.
Part I: An Introduction to Object-Oriented Software DevelopmentThis part introduces you to a method for developing object-oriented software that is based on patterns-the insights and best practices learned by designers and users over the years-and on the modeling language (UML) that supports this method. Chapter 1. The Object-Oriented ParadigmThis chapter introduces you to the object-oriented paradigm by comparing and contrasting it with something familiar: standard structured programming.
Chapter 2. The UML—The Unified Modeling LanguageThis chapter provides a brief overview of the Unified Modeling Language (UML), the modeling language of the object-oriented community. If you do not already know the UML, this chapter gives you the minimal understanding you need to be able to read the diagrams contained in this book.
Part II: The Limitations of Traditional Object-Oriented DesignIn these chapters we solve a real world problem using standard object-oriented methods. In other words, we over rely on inheritance. This problem illustrates how easy it is to get trapped into a model which solves things by special casing everything. This is not a fabricated problem, but was a problem encountered by one of the authors when he was just learning to use design patterns. Chapter 3. A Problem That Cries Out for Flexible CodeThis chapter examines the CAD/CAM problem, the vocabulary of the domain, and important features of the problem. Because the CAD/CAM system continues to evolve, the problem cries out for flexible code.
Chapter 4. A Standard Object-Oriented SolutionThis chapter describes a solution based on object orientation. It is not a great solution, but it is a solution that would work.
Part III: Design PatternsThis part introduces design patterns: what they are and how to use them. Several patterns pertinent to the CAD/CAM problem from Chapter 3 are described. They are presented individually and then related to the earlier problem. Throughout the pattern-learning chapters, I emphasize the object-oriented strategies espoused by the Gang of Four (as the authors Gamma, Helm, Johnson, and Vlissides are often referred to) in their seminal work, Design Patterns: Elements of Reusable Object-Oriented Software. Chapter 5. An Introduction to Design PatternsThis chapter introduces the concept of design patterns. It discusses their origins in architecture and how they apply in the discipline of software design. It examines the motivations for studying design patterns.
Chapter 6. The Facade PatternThis chapter explains what the Facade pattern is and where it is used, the key features of the pattern, some variations on the pattern, and relates it to the CAD/CAM problem.
Chapter 7.The Adapter PatternThis chapter continues the study of design patterns with the Adapter pattern. This chapter explains the key features of this common pattern, uses it to illustrate polymorphism, includes a comparison of it to the Facade pattern, and relates it to the CAD/CAM problem.
Chapter 8. Expanding Our HorizonsMany people learned object-oriented with definitions that are actually fairly limiting. This chapter introduces more powerful perspectives in looking at polymorphism, abstraction, classes and encapsulation. This new perspective is essential to truly understanding design patterns. It uses what has been learned in Chapters 5 through 7.
Chapter 9. The Strategy PatternThis chapter introduces a new case study, which comes from the area of e-commerce (electronic commerce over the Internet). It also begins a solution using the Strategy pattern.
Chapter 10. The Bridge PatternThis chapter continues the discussion of design patterns with the Bridge pattern. The Bridge pattern is quite a bit more complex than the other patterns explored heretofore. It is also much more useful. Therefore, this chapter provides detail on how to learn this pattern including key features, an example on how to derive it, and observations from practice.
Chapter 11. The Abstract Factory PatternThe pattern that can be used to control the creation of families of objects is presented, with key features, an example to help derive it, and relates it to the CAD/CAM problem.
Part IV: Putting It All Together: Thinking in PatternsIn this part, an approach is proposed to designing object-oriented systems based on patterns, which has been proven in real design practice. This approach first tries to understand the context in which objects show up. The approach is applied to the CAD/CAM problem. Chapter 12. How Do Experts Design?Alternate between the big picture and the specific details. Design patterns give us a way to focus on relationships between our objects. Christopher Alexander’s design methods give us clues in how to use design patterns conceptually. Thinking in terms of patterns instead of the classes.
Chapter 13. Solving Our CAD/CAM Problem with Design PatternsIn this chapter, Alexander’s hypothesized approach with design patterns is applied to solve the CAD/CAM problem presented in Chapter 3, “A Problem That Cries Out for Flexible Code.”
Part V: Toward a New Paradigm of DesignAlthough patterns are useful in their own right, the lessons learned from them can be used to create a different approach to designing application architectures from one that focuses on specialization or identifying the nouns and verbs of the problem domain. In this part, ways are discussed to design application architectures based on the lessons learned from design patterns. Chapter 14. The Principles and Strategies of Design PatternsHaving learned several design patterns and seeing how they work together, we now step back and look at how what we have just learned illustrates common principles of design.
Chapter 15. Commonality and Variability AnalysisThis chapter shows how to use commonality and variability analysis (CVA) to develop a high-level application design. Although design patterns can’t be used in all designs, the lessons learned from them can.
Chapter 16. The Analysis MatrixThis chapter continues the e-commerce case study discussed earlier in Chapter 9, “The Strategy Pattern.” It then steps back to look at one of the biggest problems in software development: handling variation within the problem domain. Design patterns can help analysts identify and organize variations successfully.
Chapter 17. The Decorator PatternThis chapter continues the e-commerce case study introduced in Chapter 9, “The Strategy Pattern,” by describing a new requirement for the case study and showing how the Decorator pattern can handle the requirement flexibly. Also discussed are key features of the Decorator pattern, experiences of real world practice, and how it can be used to handle input/output.
Part VI: Other Values of PatternsThis part extends the notion of patterns containing variation by illustrating different types of variation that can occur besides functionality. Chapter 18. The Observer PatternThis chapter introduces the categorization scheme of patterns, describes key features of and experiences in using the Observer pattern, and applies the Observer pattern to additional requirements for the e-commerce case study.
Chapter 19. The Template Method PatternThis chapter introduces the Template Method pattern by revealing its intent, describing its features, exploring how it can eliminate redundancy, sharing how it has been used in real world practice, and has it tackle additional requirements for the e-commerce case study.
Part VII: FactoriesFactory patterns help with the creation of objects. But that may not be their most important use. Seen from the new perspective, this part shows how they are much more. Chapter 20. Lessons from Design Patterns: FactoriesDisclosed is how following the principles and practices of patterns implies we have to separate the use of objects from the construction/management of objects, hence factories.
Chapter 21. The Singleton Pattern and the Double-Checked Locking PatternA couple of simple factories are portrayed that ensure only one object of a type exists.
Chapter 22. The Object Pool PatternA past project is related in which the Object-Pool pattern was derived from the practices learned from patterns. This example also illustrates how the knowledge of patterns facilitates agile practices.
Chapter 23. The Factory Method PatternIt is illustrated how the Factory Method pattern is useful for coordinating two interrelated class hierarchies.
Chapter 24. Summary of FactoriesThe use of object factory/managers set forth in this section are summarized.
Part VIII: Endings and BeginningsThis part continues with the new perspective on object-oriented design. In particular, this part describes how design patterns use this perspective in their design and implementation. Chapter 25. Design Patterns Reviewed: A Summation and a BeginningLooks at the motivations and relationships of design patterns within the context of this new perspective on object-oriented design.
Chapter 26. BibliographySuggests books and other resources for future study
|