did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780321247148

Design Patterns Explained A New Perspective on Object-Oriented Design

by ;
  • ISBN13:

    9780321247148

  • ISBN10:

    0321247140

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2004-10-12
  • Publisher: Addison-Wesley Professional

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
  • Complimentary 7-Day eTextbook Access - Read more
    When you rent or buy this book, you will receive complimentary 7-day online access to the eTextbook version from your PC, Mac, tablet, or smartphone. Feature not included on Marketplace Items.
List Price: $59.99 Save up to $15.00
  • Buy Used
    $44.99
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 2-4 BUSINESS DAYS

    7-Day eTextbook Access 7-Day eTextbook Access

Supplemental Materials

What is included with this book?

Summary

"One of the great things about the book is the way the authors explain concepts very simply using analogies rather than programming examplesthis has been very inspiring for a product I'm working on: an audio-only introduction to OOP and software development." Bruce Eckel "...I would expect that readers with a basic understanding of object-oriented programming and design would find this book useful, before approaching design patterns completely.Design Patterns Explainedcomplements the existing design patterns texts and may perform a very useful role, fitting between introductory texts such as UML Distilled and the more advanced patterns books." James Noble Leverage the quality and productivity benefits of patternswithout the complexity!Design Patterns Explained, Second Editionis the field's simplest, clearest, most practical introduction to patterns. Using dozens of updated Java examples, it shows programmers and architects exactly how to use patterns to design, develop, and deliver software far more effectively. You'll start with a complete overview of the fundamental principles of patterns, and the role of object-oriented analysis and design in contemporary software development. Then, using easy-to-understand sample code, Alan Shalloway and James Trott illuminate dozens of today's most useful patterns: their underlying concepts, advantages, tradeoffs, implementation techniques, and pitfalls to avoid. Many patterns are accompanied by UML diagrams. Building on their best-selling First Edition, Shalloway and Trott have thoroughly updated this book to reflect new software design trends, patterns, and implementation techniques. Reflecting extensive reader feedback, they have deepened and clarified coverage throughout, and reorganized content for even greater ease of understanding. New and revamped coverage in this edition includes Better ways to start "thinking in patterns" How design patterns can facilitate agile development using eXtreme Programming and other methods How to use commonality and variability analysis to design application architectures The key role of testing into a patterns-driven development process How to use factories to instantiate and manage objects more effectively The Object-Pool Patterna new pattern not identified by the "Gang of Four" New study/practice questions at the end of every chapter Gentle yet thorough, this book assumes no patterns experience whatsoever. It's the ideal "first book" on patterns, and a perfect complement to Gamma's classicDesign Patterns. If you're a programmer or architect who wants the clearest possible understanding of design patternsor if you've struggled to make them work for youread this book.

Author Biography

Alan Shalloway is founder, CEO, and principal consultant of Net Objectives, an object-oriented consulting and training organization. An object-oriented consultant and software developer for over 20 years, he is a frequent speaker at leading development conferences, including SD Expo, Java One, OOP, and OOPSLA. He is a certified Scrum master. He is co-author of An Introduction to XML and its Family of Technologies. Shalloway holds a master's degree in computer science from MIT.

James R. Trott currently works as a senior consultant for a large financial institution in the Pacific Northwest. He has used object-oriented and pattern-based analysis techniques throughout his 20-year career in knowledge management and knowledge engineering. He holds a master of science in applied mathematics, an MBA, and a master of arts in intercultural studies.


© Copyright Pearson Education. All rights reserved.

Table of Contents

Preface xix
From Object Orientation to Patterns to True Object Orientation
xxi
From Artificial Intelligence to Patterns to True Object Orientation
xxviii
A Note About Conventions Used in This Book
xxx
Feedback
xxxiv
New in the Second Edition
xxxiv
Acknowledgments
xxxv
PART I An Introduction to Object-Oriented Software Development 1(46)
Chapter 1 The Object-Oriented Paradigm
3(30)
Overview
3(1)
Before the Object-Oriented Paradigm: Functional Decomposition
4(2)
The Problem of Requirements
6(2)
Dealing with Changes: Using Functional Decomposition
8(3)
Dealing with Changing Requirements
11(4)
The Object-Oriented Paradigm
15(8)
Object-Oriented Programming in Action
23(4)
Special Object Methods
27(1)
Summary
28(2)
Review Questions
30(3)
Chapter 2 The UML-The Unified Modeling Language
33(14)
Overview
33(1)
What Is the UML?
33(1)
Why Use the UML?
34(1)
The Class Diagram
35(7)
Interaction Diagrams
42(3)
Summary
45(1)
Review Questions
45(2)
PART II The Limitations of Traditional Object-Oriented Design 47(26)
Chapter 3 A Problem That Cries Out for Flexible Code
49(12)
Overview
49(1)
Extracting Information from a CAD/CAM System
49(1)
Understand the Vocabulary
50(2)
Describe the Problem
52(3)
The Essential Challenges and Approaches
55(3)
Summary
58(1)
Review Questions
59(2)
Chapter 4 A Standard Object-Oriented Solution
61(12)
Overview
61(1)
Solving with Special Cases
61(9)
Summary
70(1)
Review Questions
71(2)
PART III Design Patterns 73(142)
Chapter 5 An Introduction to Design Patterns
75(18)
Overview
75(1)
Design Patterns Arose from Architecture and Anthropology
76(5)
Moving from Architectural to Software Design Patterns
81(2)
Why Study Design Patterns?
83(5)
Other Advantages of Studying Design Patterns
88(2)
Summary
90(1)
Review Questions
90(3)
Chapter 6 The Facade Pattern
93(8)
Overview
93(1)
Introducing the Facade Pattern
93(1)
Learning the Facade Pattern
94(3)
Field Notes: The Facade Pattern
97(2)
Relating the Facade Pattern to the CAD/CAM Problem
99(1)
Summary
99(1)
Review Questions
99(2)
Chapter 7 The Adapter Pattern
101(14)
Overview
101(1)
Introducing the Adapter Pattern
101(1)
Learning the Adapter Pattern
102(5)
Field Notes: The Adapter Pattern
107(4)
Relating the Adapter Pattern to the CAD/CAM Problem
111(1)
Summary
112(1)
Review Questions
112(3)
Chapter 8 Expanding Our Horizons
115(24)
Overview
115(2)
Objects: The Traditional View and the New View
117(2)
Encapsulation: The Traditional View and the New View
119(4)
Find What Is Varying and Encapsulate It
123(4)
Commonality and Variability Analysis and Abstract Classes
127(3)
The Qualities of Agile Coding
130(5)
Summary
135(1)
Review Questions
136(3)
Chapter 9 The Strategy Pattern
139(20)
Overview
139(1)
An Approach to Handling New Requirements
139(3)
The International E-Commerce System Case Study: Initial Requirements
142(1)
Handling New Requirements
143(9)
The Strategy Pattern
152(2)
Field Notes: Using the Strategy Pattern
154(2)
Summary
156(1)
Review Questions
157(2)
Chapter 10 The Bridge Pattern
159(34)
Overview
159(1)
Introducing the Bridge Pattern
159(2)
Learning the Bridge Pattern: An Example
161(11)
An Observation About Using Design Patterns
172(1)
Learning the Bridge Pattern: Deriving It
173(10)
The Bridge Pattern in Retrospect
183(1)
Field Notes: Using the Bridge Pattern
183(5)
Summary
188(3)
Review Questions
191(2)
Chapter 11 The Abstract Factory Pattern
193(22)
Overview
193(1)
Introducing the Abstract Factory Pattern
193(1)
Learning the Abstract Factory Pattern: An Example
194(8)
Learning the Abstract Factory Pattern: Implementing It
202(5)
Field Notes: The Abstract Factory Pattern
207(4)
Relating the Abstract Factory Pattern to the CAD/CAM Problem
211(1)
Summary
211(1)
Review Questions
212(3)
PART IV Putting It All Together: Thinking in Patterns 215(36)
Chapter 12 How Do Experts Design?
217(12)
Overview
217(1)
Building by Adding Distinctions
217(9)
Summary
226(1)
Review Questions
226(3)
Chapter 13 Solving the CAD/CAM Problem with Patterns
229(22)
Overview
229(1)
Review of the CAD/CAM Problem
229(2)
Thinking in Patterns
231(2)
Thinking in Patterns: Step 1
233(1)
Thinking in Patterns: Step 2a
233(6)
Thinking in Patterns: Step 2b
239(5)
Thinking in Patterns: Step 2c
244(1)
Thinking in Patterns: Steps 2a and 2b Repeated (Facade)
244(1)
Thinking in Patterns: Steps 2a and 2b Repeated (Adapter)
245(1)
Thinking in Patterns: Steps 2a and 2b Repeated (Abstract Factory)
246(1)
Thinking in Patterns: Step 3
246(1)
Comparison with the Previous Solution
247(2)
Summary
249(1)
Review Questions
250(1)
PART V Toward a New Paradigm of Design 251(62)
Chapter 14 The Principles and Strategies of Design Patterns
253(16)
Overview
253(1)
The Open-Closed Principle
254(1)
The Principle of Designing from Context
255(6)
The Principle of Encapsulating Variation
261(1)
Abstract Classes vs. Interfaces
262(2)
The Principle of Healthy Skepticism
264(1)
Summary
265(1)
Review Questions
266(3)
Chapter 15 Commonality and Variability Analysis
269(10)
Overview
269(1)
Commonality and Variability Analysis and Application Design
269(1)
Solving the CAD/CAM Problem with CVA
270(7)
Summary
277(1)
Review Questions
277(2)
Chapter 16 The Analysis Matrix
279(18)
Overview
279(1)
In The Real World: Variations
279(1)
The International E-Commerce System Case Study: Handling Variation
280(11)
Held Notes
291(3)
Summary
294(1)
Review Questions
294(3)
Chapter 17 The Decorator Pattern
297(16)
Overview
297(1)
A Little More Detail
297(3)
The Decorator Pattern
300(1)
Applying the Decorator Pattern to the Case Study
301(4)
Another Example: Input/Output
305(2)
Field Notes: Using the Decorator Pattern
307(2)
The Essence of the Decorator Pattern
309(1)
Summary
310(1)
Review Questions
310(3)
PART VI Other Values of Patterns 313(32)
Chapter 18 The Observer Pattern
315(16)
Overview
315(1)
Categories of Patterns
315(2)
More Requirements for the International E-Commerce Case Study
317(2)
The Observer Pattern
319(1)
Applying the Observer to the Case Study
319(6)
Field Notes: Using the Observer Pattern
325(2)
Summary
327(1)
Review Questions
328(3)
Chapter 19 The Template Method Pattern
331(14)
Overview
331(1)
More Requirements for the International E-Commerce Case Study
331(1)
The Template Method Pattern
332(1)
Applying the Template Method to the International E-Commerce Case Study
333(1)
Using the Template Method Pattern to Reduce Redundancy
334(6)
Field Notes: Using the Template Method Pattern
340(1)
Summary
341(2)
Review Questions
343(2)
PART VII Factories 345(52)
Chapter 20 Lessons from Design Patterns: Factories
347(12)
Overview
347(1)
Factories
347(2)
The Universal Context Revisited
349(2)
Factories Follow Our Guidelines
351(2)
Limiting the Vectors of Change
353(1)
Another Way to Think About It
354(1)
Different Roles of Factories
355(1)
Field Notes
355(1)
Summary
356(1)
Review Questions
356(3)
Overview
359(1)
Chapter 21 The Singleton Pattern and the Double-Checked Locking Pattern
359(12)
Introducing the Singleton Pattern
360(1)
Applying the Singleton Pattern to the Case Study
361(3)
A Variant: The Double-Checked Locking Pattern
364(3)
Reflections
367(1)
Field Notes: Using the Singleton and Double-Checked Locking Patterns
368(1)
Summary
369(1)
Review Questions
369(2)
Chapter 22 The Object Pool Pattern
371(14)
Overview
371(1)
A Problem Requiring the Management of Objects
372(9)
The Object Pool Pattern
381(1)
Observation: Factories Can Do Much More Than Instantiation
381(3)
Summary
384(1)
Review Questions
384(1)
Chapter 23 The Factory Method Pattern
385(8)
Overview
385(1)
More Requirements for the Case Study
385(1)
The Factory Method Pattern
386(1)
Factory Method Pattern and Object-Oriented Languages
387(1)
Field Notes: Using the Factory Method Pattern
388(2)
Summary
390(1)
Review Questions
390(3)
Chapter 24 Summary of Factories
393(4)
Overview
393(1)
Steps in the Software Process
393(2)
Parallels in Factories and XP Practices
395(1)
Scaling Systems
395(2)
PART VIII Endings and Beginnings 397(22)
Chapter 25 Design Patterns Reviewed: A Summation and a Beginning
399(10)
Overview
399(1)
A Summary of Object-Oriented Principles
400(1)
How Design Patterns Encapsulate Implementations
401(1)
Commonality and Variability Analysis and Design Patterns
401(1)
Decomposing a Problem Domain into Responsibilities
402(1)
Patterns and Contextual Design
403(1)
Relationships Within a Pattern
404(1)
Design Patterns and Agile Coding Practices
405(1)
Field Notes
406(1)
Summary
407(1)
Review Questions
408(1)
Chapter 26 Bibliography
409(10)
Design Patterns Explained: The Web Site Companion
410(1)
Recommended Reading
410(2)
Recommended Reading for Java Programmers
412(1)
Recommended Reading for C++ Programmers
413(1)
Recommended Reading for COBOL Programmers
414(1)
Recommended Reading on eXtreme Programming
414(1)
Recommended Reading on General Programming
415(1)
Personal Favorites
415(4)
Index 419

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

Preface Should You Buy the Second Edition If You Already Own the First? The answer, of course, is yes! Here's why. Since the first edition was written, we have learned so much more about design patterns, including the following: How to use commonality and variability analysis to design application architectures How design patterns relate to and actually facilitate eXtreme programming (XP) and agile development. How testing is a first principle of quality coding. Why the use of factories to instantiate and manage objects is critical Which set of patterns are essential for students to help them learn how to think in patterns This book covers all of these topics. We have deepened and clarified what we had before and have added some new content that you will find very helpful, including the following: Chapter 15: Commonality and Variability Analysis Chapter 20: Lessons from Design Patterns: Factories Chapter 21: The Object-Pool Pattern (a pattern not covered by the Gang of Four) Chapter 22: Factories Summarized We have changed the order in which we present some of the patterns. This sequence is more helpful for the students in our courses as they learn the ideas behind patterns. We have touched every chapter, incorporating the feedback we have received from our many readers over these past three years. And, to help students, we have created study questions for each chapter (with answers on the book's companion Web site). We can honestly say this is one of the few second editions that is definitely worth buying -- even if you have the first one. We would love to hear what you think. --Alan and Jim Design patterns and object-oriented programming. They hold such promise to make your life as a software designer and developer easier. Their terminology is bandied about every day in the technical and even the popular press. It can be hard to learn them, however, to become proficient with them, to understand what is really going on. Perhaps you have been using an object-oriented or object-based language for years. Have you learned that the true power of objects is not inheritance, but is in "encapsulating behaviors"? Perhaps you are curious about design patterns and have found the literature a bit too esoteric and high-falutin. If so, this book is for you. It is based on years of teaching this material to software developers, both experienced and new to object orientation. It is based upon the belief--and our experience--that when you understand the basic principles and motivations that underlie these concepts, why they are doing what they do, your learning curve will be incredibly shorter. And in our discussion of design patterns, you will understand the true mindset of object orientation, which is a necessity before you can become proficient. As you read this book, you will gain a solid understanding of 12 core design patterns and a pattern used in analysis. You will learn that design patterns do not exist in isolation, but work in concert with other design patterns to help you create more robust applications. You will gain enough of a foundation that you will be able to read the design pattern literature, if you want to, and possibly discover patterns on your own. Most importantly, you will be better equipped to create flexible and complete software that is easier to maintain. Although the 12 patterns we teach here are not all of the patterns you should learn, an understanding of these will enable you to learn the others on your own more easily. Instead of giving you more patterns than you need to get started, we have included pattern-related issues that will

Rewards Program