Object-Oriented Reengineering Patterns
- Serge Demeyer, University of Antwerp, Belgium.
- Stéphane Ducasse, University of Bern, Switzerland.
- Oscar Nierstrasz, University of Bern, Switzerland.
The documentation is missing or obsolete, and the original developers have departed. Your team has limited understanding of the system, and unit tests are missing for many, if not all, of the components. When you fix a bug in one place, another bug pops up somewhere else in the system. Long rebuild times make any change difficult. All of these are signs of software that is close to the breaking point.Many systems can be upgraded or simply thrown away if they no longer serve their purpose. Legacy software, however, is crucial for operations and needs to be continually available and upgraded. How can you reduce the complexity of a legacy system sufficiently so that it can continue to be used and adapted at acceptable cost?Based on the authors' industrial experiences, this book is a guide on how to reverse engineer legacy systems to understand their problems, and then reengineer those systems to meet new demands. Patterns are used to clarify and explain the process of understanding large code bases, hence transforming them to meet new requirements. The key insight is that the right design and organization of your system is not something that can be evident from the initial requirements alone, but rather as a consequence of understanding how these requirements evolve.View full description
Software Engineers, Programmers, Designers, System Architects, and Students.
- Published: July 2002
- Imprint: MORGAN KAUFMANN
- ISBN: 978-1-55860-639-5
"'How' to refactor is already well covered in the literature. However, 'When' and 'Why' can only be learned by experience. This book will give you a head start in learning when to start redesigning a system, when to stop for now, and what effects you can expect to see from your efforts." ¿Kent Beck, Director, Three Rivers Institute "This book full of practical, hands-on reengineering knowledge and expertise presented in a form that makes it easy to understand and use. The patterns in this book thus help everyone who is concerned with reengineering to guide their work. I wished I had had this book in my library earlier." ¿Frank Buschmann, Senior Principal Engineer, Siemens AG "This book is more than its title advertises. Effective reengineering is really about purposeful and efficient reading of someone else's code in order to produce predictable change. The same processes the authors highlight as patterns of skillful reengineering behavior can easily be cast as the skills you need to create readable, maintainable software systems." ¿Adele Goldberg, Neometron, Inc. "If a guy named Dave brought a large box to my office that contained a lot of documentation and two CDs¿installation disks for software that my company wanted to reengineer¿I'd be happy to have the authors of this book at my side. Barring that, having their book is the next best thing. No silver bullets, no hype, no promises that this will be easy¿just a down-to-earth, easy-to-read, extremely useful book of helpful guidelines to tackle the project. Buy this book and browse it before Dave arrives in your office! It just might save you and your company a lot of grief." ¿Linda Rising, Independent Consultant
Table of ContentsPrefaceChapter 1 Reengineering Patterns Why Do We Reengineer? What's Special about Objects? The Reengineering Life Cycle Reengineering Patterns The Form of a Reengineering Pattern A Map of Reengineering Patterns PART I Reverse Engineering Chapter 2 Setting Direction Forces Overview Pattern 2.1 Agree on Maxims Pattern 2.2 Appoint a Navigator Pattern 2.3 Speak to the Round Table Pattern 2.4 Most Valuable First Pattern 2.5 Fix Problems, Not Symptoms Pattern 2.6 If It Ain't Broke, Don't Fix It Pattern 2.7 Keep It Simple Chapter 3 First Contact Forces Overview What Next Pattern 3.1 Chat with the Maintainers Pattern 3.2 Read All the Code in One Hour Pattern 3.3 Skim the Documentation Pattern 3.4 Interview during Demo Pattern 3.5 Do a Mock Installation Chapter 4 Initial Understanding Forces Overview What Next Pattern 4.1 Analyze the Persistent Data Pattern 4.2 Speculate about Design Pattern 4.3 Study the Exceptional Entities Chapter 5 Detailed Model Capture Forces Overview What Next Pattern 5.1 Tie Code and Questions Pattern 5.2 Refactor to Understand Pattern 5.3 Step through the Execution Pattern 5.4 Look for the Contracts Pattern 5.5 Learn from the Past PART II ReengineeringChapter 6 Tests: Your Life Insurance! Forces Overview Pattern 6.1 Write Tests to Enable Evolution Pattern 6.2 Grow Your Test Base Incrementally Pattern 6.3 Use a Testing Framework Pattern 6.4 Test the Interface, Not the Implementation Pattern 6.5 Record Business Rules as Tests Pattern 6.6 Write Tests to Understand Chapter 7 Migration Strategies Forces Overview Pattern 7.1 Involve the Users Pattern 7.2 Build Confidence Pattern 7.3 Migrate Systems Incrementally Pattern 7.4 Prototype the Target Solution Pattern 7.5 Always Have a Running Version Pattern 7.6 Regression Test after Every Change Pattern 7.7 Make a Bridge to the New Town Pattern 7.8 Present the Right Interface Pattern 7.9 Distinguish Public from Published Interface Pattern 7.10 Deprecate Obsolete Interfaces Pattern 7.11 Conserve Familiarity Pattern 7.12 Use Profiler before Optimizing Chapter 8 Detecting Duplicated Code Forces Overview Pattern 8.1 Compare Code Mechanically Pattern 8.2 Visualize Code as Dotplots Chapter 9 Redistribute Responsibilities Forces Overview Pattern 9.1 Move Behavior Close to Data Pattern 9.2 Eliminate Navigation Code Pattern 9.3 Split Up God Class Chapter 10 Transform Conditionals to Polymorphism Forces Overview Pattern 10.1 Transform Self Type Checks Pattern 10.2 Transform Client Type Checks Pattern 10.3 Factor Out State Pattern 10.4 Factor Out Strategy Pattern 10.5 Introduce Null Object Pattern 10.6 Transform Conditionals into Registration Appendix Thumbnail patterns Testing Patterns A.1 Retest Persistent Problems A.2 Test Fuzzy Features A.3 Test Old Bugs Refactorings A.4 Encapsulate Field A.5 Extract Method A.6 Move Method A.7 Rename Attribute A.8 Rename Method A.9 Replace Conditional with Polymorphism Design Patterns A.10 Abstract Factory A.11 Adapter A.12 Facade A.13 Factory Method A.14 Flyweight A.15 Null Object A.16 Quantity A.17 Singleton A.18 State A.19 State Patterns A.20 Strategy A.21 Template Method A.22 Visitor References Index