Refactoring to Patterns
Joshua Kerievsky

ISBN-10: 0321213351
ISBN-13: 9780321213358

Publisher: Addison-Wesley Professional
Copyright: 2005
Format: Cloth; 400 pp
Published: 08/05/2004

Suggested retail price: $59.99
Buy from myPearsonStore



With the highly anticipated Refactoring to Patterns, Joshua Kerievsky has changed our approach to design by forever uniting patterns with the evolutionary process of refactoring.

Intended for the more experienced student, this book introduces the theory and practice of pattern-directed refactorings: sequences of low-level refactorings that allow designers to safely move designs to, towards, or away from pattern implementations. Using code from real-world projects, Kerievsky documents the thinking and steps underlying over two dozen pattern-based design transformations. Along the way he offers insights into pattern differences and how to implement patterns in the simplest possible ways.

This book lays the foundation for maximizing the use of design patterns by helping the reader view them in the context of refactorings.

° Groundbreaking work! Part of Martin Fowler's Signature Series, developed with significant input from Fowler himself

° Ties together two of the most popular methods in software engineering today -- refactoring and design patterns

° Helps software designers improve their efficiency and create more robust software

Foreword by Ralph Johnson.

Foreword by Martin Fowler.

Preface.

What Is This Book About?

What Are the Goals of This Book?

Who Should Read This Book?

What Background Do You Need?

How to Use This Book.

The History of This Book.

Standing on the Shoulders of Giants.

Acknowledgments.

1. Why I Wrote This Book.

Over-Engineering.

The Patterns Panacea.

Under-Engineering.

Test-Driven Development and Continuous Refactoring.

Refactoring and Patterns.

Evolutionary Design.

2. Refactoring.

What Is Refactoring?

What Motivates Us to Refactor?

Many Eyes.

Human-Readable Code.

Keeping It Clean.

Small Steps.

Design Debt.

Evolving a New Architecture.

Composite and Test-Driven Refactorings.

The Benefits of Composite Refactorings.

Refactoring Tools.

3. Patterns.

What Is a Pattern?

Patterns Happy.

There Are Many Ways to Implement a Pattern.

Refactoring to, towards, and away from Patterns.

Do Patterns Make Code More Complex?

Pattern Knowledge.

Up-Front Design with Patterns.

4. Code Smells.

Duplicated Code.

Long Method.

Conditional Complexity.

Primitive Obsession.

Indecent Exposure.

Solution Sprawl.

Alternative Classes with Different Interfaces.

Lazy Class.

Large Class.

Switch Statements.

Combinatorial Explosion.

Oddball Solution.

5. A Catalog of Refactorings to Patterns.

Format of the Refactorings.

Projects Referenced in This Catalog.

A Starting Point.

A Study Sequence.

6. Creation.

Replace Constructors with Creation Methods.

Move Creation Knowledge to Factory.

Encapsulate Classes with Factory.

Introduce Polymorphic Creation with Factory Method.

Encapsulate Composite with Builder.

Inline Singleton.

7. Simplification.

Compose Method.

Replace Conditional Logic with Strategy.

Move Embellishment to Decorator.

Replace State-Altering Conditionals with State 166

Replace Implicit Tree with Composite.

Replace Conditional Dispatcher with Command.

8. Generalization.

Form Template Method.

Extract Composite.

Replace One/Many Distinctions with Composite.

Replace Hard-Coded Notifications with Observer.

Unify Interfaces with Adapter.

Extract Adapter.

Replace Implicit Language with Interpreter.

9. Protection.

Replace Type Code with Class.

Limit Instantiation with Singleton.

10. Accumulation.

Move Accumulation to Collecting Parameter.

Move Accumulation to Visitor.

11. Utilities.

Chain Constructors.

Unify Interfaces.

Extract Parameter.

Afterword by John Brant and Don Roberts.

References.

Index.

 

Joshua Kerievsky is the founder of Industrial Logic (http://industriallogic.com), a company specializing in Extreme Programming. Since 1988, Joshua has been a professional software developer, coach, and instructor for clients such as Bankers Trust, MTV, MBNA, Ansys, MDS Sciex, Nielsen Media Research, and Sun Microsystems. He speaks regularly at conferences, has written numerous articles, and contributed chapters to Extreme Programming Explored (Addison-Wesley, 2001) and Extreme Programming Perspectives (Addison-Wesley, 2002). Joshua lives with his wife and daughters in Berkeley, California.



In 1994, Design Patterns changed the landscape of object-oriented development by introducing classic solutions to recurring design problems. In 1999, Refactoring revolutionized design by introducing an effective process for improving code. With the highly anticipated Refactoring to Patterns, Joshua Kerievsky has changed our approach to design by forever uniting patterns with the evolutionary process of refactoring.

This book introduces the theory and practice of pattern-directed refactorings: sequences of low-level refactorings that allow designers to safely move designs to, towards, or away from pattern implementations. Using code from real-world projects, Kerievsky documents the thinking and steps underlying over two dozen pattern-based design transformations. Along the way he offers insights into pattern differences and how to implement patterns in the simplest possible ways.

Coverage includes:

  • A catalog of twenty-seven pattern-directed refactorings, featuring real-world code examples
  • Descriptions of twelve design smells that indicate the need for this book’s refactorings
  • General information and new insights about patterns and refactoring
  • Detailed implementation mechanics: how low-level refactorings are combined to implement high-level patterns
  • Multiple ways to implement the same pattern—and when to use each
  • Practical ways to get started even if you have little experience with patterns or refactoring

Refactoring to Patterns reflects three years of refinement and the insights of more than sixty software engineering thought leaders in the global patterns, refactoring, and agile development communities. Whether you’re focused on legacy or “greenfield” development, this book will make you a better software designer by helping you learn how to make important design changes safely and effectively.



View a Sample Chapter PDF:

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, contact your Pearson Higher Education representative for pricing and ordering information.

This title is a member of the Addison-Wesley Signature Series, which also contains the titles below . You can also visit the Addison-Wesley Signature Series page.

  • 0201775948Beyond Software Architecture: Creating and Sustaining Winning Solutions
    Hohmann
    © 2003 | Addison-Wesley Professional | Paper; 352 pages | Instock
    ISBN-10: 0201775948 | ISBN-13: 9780201775945
    Brief Description | Buy from myPearsonStore

  • 0321336380Continuous Integration: Improving Software Quality and Reducing Risk
    Duvall, Matyas & Glover
    © 2007 | Addison-Wesley Professional | Paper; 336 pages | Instock
    ISBN-10: 0321336380 | ISBN-13: 9780321336385
    Buy from myPearsonStore

  • 0321413091Implementation Patterns
    Beck
    © 2008 | Addison-Wesley Professional | Paper; 176 pages | Instock
    ISBN-10: 0321413091 | ISBN-13: 9780321413093
    Buy from myPearsonStore

  • 0321437381Implementing Lean Software Development: From Concept to Cash
    Poppendieck & Poppendieck
    © 2007 | Addison-Wesley Professional | Paper; 304 pages | Instock
    ISBN-10: 0321437381 | ISBN-13: 9780321437389
    Buy from myPearsonStore

  • 0321127420Patterns of Enterprise Application Architecture
    Fowler
    © 2003 | Addison-Wesley Professional | Cloth; 560 pages | Instock
    ISBN-10: 0321127420 | ISBN-13: 9780321127426
    Brief Description | Buy from myPearsonStore

  • 0321293533Refactoring Databases: Evolutionary Database Design
    Ambler & Sadalage
    © 2006 | Addison-Wesley Professional | Cloth; 384 pages | Instock
    ISBN-10: 0321293533 | ISBN-13: 9780321293534
    Buy from myPearsonStore

  • 0321503635Refactoring HTML: Improving the Design of Existing Web Applications
    Harold
    © 2008 | Addison-Wesley Professional | Cloth; 368 pages | Instock
    ISBN-10: 0321503635 | ISBN-13: 9780321503633
    Buy from myPearsonStore

  • 0321213351Refactoring to Patterns
    Kerievsky
    © 2005 | Addison-Wesley Professional | Cloth; 400 pages | Instock
    ISBN-10: 0321213351 | ISBN-13: 9780321213358
    Brief Description | Buy from myPearsonStore

  • 0321146530Test Driven Development: By Example
    Beck
    © 2003 | Addison-Wesley Professional | Paper; 240 pages | Instock
    ISBN-10: 0321146530 | ISBN-13: 9780321146533
    Brief Description | Buy from myPearsonStore

  • 0321205685User Stories Applied: For Agile Software Development
    Cohn
    © 2004 | Addison-Wesley Professional | Paper; 304 pages | Instock
    ISBN-10: 0321205685 | ISBN-13: 9780321205681
    Brief Description | Buy from myPearsonStore

  • 0131495054xUnit Test Patterns: Refactoring Test Code
    Meszaros
    © 2007 | Addison-Wesley Professional | Cloth; 944 pages | Instock
    ISBN-10: 0131495054 | ISBN-13: 9780131495050
    Buy from myPearsonStore

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students contact your Pearson Higher Education representative.


Copyright ©2009 Pearson Education. All rights reserved. Legal Notice | Privacy Policy | Permissions