Foreword

Design Patterns described several ways to use patterns. Some people plan for patterns long before they write any code, while other people add a pattern after a lot of code has been written. The second way of using patterns is refactoring, because you are changing the design of the system without adding features or changing the external behavior. Some people put a pattern into a program because they think the pattern will make the program easier to change, but other people do it as a way to simplify the current design. If code has been written, then both of these are refactorings, because the first is refactoring to make a change easier, while the second is refactoring to clean up after a change.

Although a pattern is something you can ...

Get Refactoring to Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.