Prefactoring

   < Day Day Up > 

book cover
Prefactoring
By Ken Pugh
...............................................
Publisher: O'Reilly
Pub Date: September 2005
ISBN: 0-596-00874-0
Pages: 238
 

Table of Contents   Index

overview

More often than not, developers will stop a large project in the middle of the build stage to rethink and recode the software design so it's cleaner and more efficient. Known as "refactoring," this process eats up valuable time and money. To help offset refactoring, this book presents a new process called "prefactoring," the premise of which states that you're better off considering the best possible design patterns before you even begin your project.


Prefactoring, in essence, is the art of applying the insights gleaned from previous experience (whether yours or someone else's) when developing software to new projects. Doing so will likely save you from making costly design changes midstream--and maybe even save your job!


This practical, thought-provoking guide details prefactoring guidelines in design, code, and testing, each derived from the lessons of many developers over many years . With these guidelines, you're far more likely to create more readable and maintainable code before you reach the second-guessing stage.


To help communicate the many facets of this process, Prefactoring follows the example of a fictitious client, Sam, as he seeks to create a software system from beginning to implementation. Among the topics covered:

  • General development issues

  • Implementation classes

  • Object-oriented design

  • Creating reports via separation of concerns

  • Associations and states

  • Creating and testing interfaces


If you understand object-oriented design, and you want to save time and money by considering more efficient designs before you begin your project, Prefactoring will show you the way. It won't guarantee that you'll never need to refactor your design or code again, but you're sure to cut down on the amount of refactoring you do.

   < Day Day Up > 
 <  Day Day Up  >  

book cover
Prefactoring
By Ken  Pugh
...............................................
Publisher: O'Reilly
Pub Date: September 2005
ISBN: 0-596-00874-0
Pages: 238
 

Table of Contents    Index


      Copyright
      Dedication
      Preface
        Everybody Is Different
        The Design Example
        Audience
        Contents of This Book
        The Cover
        Conventions Used in This Book
        Using Code Examples
        Comments and Questions
        Safari Enabled
        Acknowledgments
        Chapter One.   Introduction to Prefactoring
        Section 1.1.   What Is Prefactoring?
        Section 1.2.   The Three Extremes
        Section 1.3.   The Guidelines Explored
        Section 1.4.   The Context for This Book
        Chapter Two.   The System in So Many Words
        Section 2.1.   Meet Sam
        Section 2.2.   Reinvention Avoidance
        Section 2.3.   What's in a Name ?
        Section 2.4.   Splitters Versus Lumpers
        Section 2.5.   Clumping
        Section 2.6.   Abstracting
        Section 2.7.   Prototypes Are Worth a Thousand Words
        Chapter Three.   General Development Issues
        Section 3.1.   Start with the Big Picture
        Section 3.2.   Interface Contracts
        Section 3.3.   Validation
        Section 3.4.   Code Communicates
        Section 3.5.   Consistency Is Simplicity
        Section 3.6.   A Prefactoring Attitude
        Section 3.7.   Don't Repeat Yourself
        Section 3.8.   Documentation of Assumptions and Decisions
        Section 3.9.   Dealing with Deviations and Errors
        Section 3.10.   Speeding
        Section 3.11.   The Spreadsheet Conundrum
        Section 3.12.   Tools Are Tools ”Use Them Wisely
        Chapter Four.   Getting the Big Picture
        Section 4.1.   The Rest of the Story
        Section 4.2.   Process
        Section 4.3.   The Initial Design
        Section 4.4.   Global Planning, Local Designing
        Section 4.5.   Testing Functionality
        Section 4.6.   Testing Quality
        Section 4.7.   Security
        Chapter Five.   Got Class?
        Section 5.1.   Categories and Classes
        Section 5.2.   Declaration Versus Execution
        Section 5.3.   Appropriate Inheritance
        Section 5.4.   Communicate with Text
        Section 5.5.   More Than One
        Chapter Six.   A Few Words on Classes
        Section 6.1.   Honor the Class Maxims
        Section 6.2.   Three Laws of Objects
        Section 6.3.   Need Determines Class
        Section 6.4.   Polymorphism
        Section 6.5.   One Little Job
        Section 6.6.   Policy Versus Implementation
        Section 6.7.   Extreme Naming
        Section 6.8.   Overloading Functions
        Chapter Seven.   Getting There
        Section 7.1.   Where We Are
        Section 7.2.   Separating Concerns
        Section 7.3.   Migrating to the New System
        Chapter Eight.   The First Release
        Section 8.1.   The Proof Is in the Pudding
        Section 8.2.   Retrospective Time
        Section 8.3.   The System as It Stands Now
        Section 8.4.   Operations Interface
        Section 8.5.   Abstract Data Types
        Section 8.6.   Configuration
        Section 8.7.   Testing
        Section 8.8.   Dealing with Deviations and Errors
        Section 8.9.   A Little Prefactoring
        Section 8.10.   The First Released Iteration
        Section 8.11.   Sometimes Practice Does Not Match Theory
        Section 8.12.   The Rest of the Classes
        Chapter Nine.   Associations and States
        Section 9.1.   Sam's New Requirement
        Section 9.2.   Who's in Charge?
        Section 9.3.   The State of an Object
        Chapter Ten.   Interfaces and Adaptation
        Section 10.1.   The Catalog Search Use Case
        Section 10.2.   Designing the Interface
        Section 10.3.   Interface Development
        Section 10.4.   Interface Testing
        Section 10.5.   Interface Splitting
        Section 10.6.   Something Working
        Chapter Eleven.   Zip Codes and Interfaces
        Section 11.1.   Adaptation
        Section 11.2.   Pass the Buck
        Section 11.3.   Unwritten Code
        Section 11.4.   Indirection
        Section 11.5.   Logging
        Section 11.6.   Paradigm Mismatch
        Chapter Twelve.   More Reports
        Section 12.1.   Fancy Reports
        Section 12.2.   Change Happens
        Section 12.3.   Exports
        Chapter Thirteen.   Invoices, Credit Cards, and Discounts
        Section 13.1.   The Next Step
        Section 13.2.   The Language of the Client
        Section 13.3.   Security and Privacy
        Chapter Fourteen.   Sam Is Expanding
        Section 14.1.   The Second Store
        Section 14.2.   A New Development
        Section 14.3.   The Third Store
        Section 14.4.   Goodbye Sam
        Section 14.5.   Generality
        Chapter Fifteen.   A Printserver Example
        Section 15.1.   Introduction
        Section 15.2.   The System
        Section 15.3.   The Message
        Section 15.4.   Testing
        Section 15.5.   Logging
        Section 15.6.   Still More Separation
        Section 15.7.   Epilogue
        Chapter Sixteen.   Antispam Example
        Section 16.1.   The Context
        Section 16.2.   Spam Checking
        Section 16.3.   The ReceivingMailServer
        Section 16.4.   ReceivedMailExaminer
        Section 16.5.   The Full Flow
        Chapter Seventeen.   Epilogue
        Appendix A.   Guidelines and Principles
        Section A.1.   Guidelines
        Section A.2.   Guidelines in Alphabetical Order
        Section A.3.   Software Design Principles
        Appendix B.   Source Code
        Section B.1.   com.samscdrental.configuration Package
        Section B.2.   com.samscdrental.controller Package
        Section B.3.   com.samscdrental.dataaccess Package
        Section B.4.   com.samscdrental.display.adt Package
        Section B.5.   com.samscdrental.display Package
        Section B.6.   com.samscdrental.failures Package
        Section B.7.   com.samscdrental.helper Package
        Section B.8.   com.samscdrental.importexport Package
        Section B.9.   com.samscdrental.migration Package
        Section B.10.   com.samscdrental.model.adt Package
        Section B.11.   com.samscdrental.model.dto Package
        Section B.12.   com.samscdrental.model Package
        Section B.13.   com.samscdrental.reports Package
        Section B.14.   com.samscdrental.tests Package
      Colophon
        About the Author
        Colophon
      Index
 <  Day Day Up  >