Be the first to ask a question about Refactoring to Patterns. Lists with This Book. Community Reviews. Showing Rating details. More filters. Sort order. Oct 30, Rod Hilton rated it liked it Shelves: programming. Refactoring to Patterns essentially attempts to merge together two types of books: books on code design such as the GoF Patterns book, Head First Design Patterns, Patterns of Enterprise Application Architecture, etc and books on engineering principles such as the eXtreme Programming series and, most of all, Fowler's Refactoring.
In this, it succeeds. Refactoring to Patterns really makes explicit the relationship between agile programming practices and OO design. It draws a connection precisel Refactoring to Patterns essentially attempts to merge together two types of books: books on code design such as the GoF Patterns book, Head First Design Patterns, Patterns of Enterprise Application Architecture, etc and books on engineering principles such as the eXtreme Programming series and, most of all, Fowler's Refactoring.
It draws a connection precisely where two concepts are connected but where few books tread. Kerievsky isn't a Patternista either, he makes it clear that Patterns are often overkill for some types of problems, and he always mentions both the benefits and costs of a pattern being discussed. The main problem with the book is that it exists to create a connection that I think most people can create on their own. If you've read Refactoring and a Design Patterns book, I don't think there's a lot to be gained here. Often I found myself reading the writeup of a pattern, looking at its diagram, and skimming the "How To" section.
I'd often skip the example entirely, as it was clear by that point that I knew exactly how to refactor to a pattern. What does the code look like when it's in a state that it should be refactored to a design pattern? Kerievsky does a decent job with this goal, but often I wondered if it would have been better for him to go into more examples and detail on that subject, and spend less time taking the reader step-by-step through the actual refactoring itself. Those pages often felt like padding in a book struggling to reach pages. If you feel comfortable implementing Design Patterns but unsure of when it's appropriate to use them, this would be a good book, though I have a hard time believing there isn't a better one out there though to be fair, I can't think of one.
Otherwise, I don't think there's much to glean from the book - often pages were spent spelling out refactoring steps that anyone with some experience with Patterns probably already understands. Without context advises from pattern books like Design Patterns: Elements of Reusable Object-Oriented Software can be difficult to apply.
This is where Joshua's book shine. He walks through many different patterns, shows how messy code could look and explains how to refactor the code into patterns. Most importantly he also gives many advises to when not to apply the refactorings. I particularly likes the boxes with pros and cons for each refactoring. Although I have read both books I find it difficult to figure out which order it would be best to read the books in. But in the end all three books needs to be read multiple times to absorb all the knowledge.
The main concern I have with the book is the mechanics section that step by step explain how to apply the refactoring, right after this there is an example. I think the mechanics are almost redundant. I say almost because the section might prove usefull when using the book as a reference.
Jan 11, Mark Nenadov rated it really liked it Shelves: technology , programming. A solid resource for software developers. There is a lot of real code and explanation here. And the code displayed generally isn't some sort of pared down or contrived example. My only beef is that I found some aspects of the layout to be rather tedious, and while initially the format seems attractive and effective, by the end it seems too busy a A solid resource for software developers. My only beef is that I found some aspects of the layout to be rather tedious, and while initially the format seems attractive and effective, by the end it seems too busy and perhaps even grating due to repetition.
Jan 16, Tim rated it really liked it. Really useful reference material. You need to be comfortable with design patterns in order to fully appreciate the message of this book. The mechanics for each type of refactoring is refreshing as we're often introduced to design patterns or refactoring from a singular example. This book bridges the gap between an existing solution to one that uses design patterns.
Aug 10, Josh Hamacher rated it liked it Shelves: programming. Like several other reviewers, this book left me scratching my head slightly and wondering what its aim really was. I was hoping the focus would be more on analysis of legacy code, with advice on discovering and teasing out potential patterns. Instead, this is almost entirely a "how-to" book.
The vast majority of its pages are taken up with 27 refactorings. Each refactoring includes a "how to" section and then an often lengthy step-by-step example. Yet, if you're familiar with design pattern Like several other reviewers, this book left me scratching my head slightly and wondering what its aim really was. Yet, if you're familiar with design patterns and refactorings, both sections could be significantly shorter. Only about 50 pages are devoted to the when-and-why of refactoring, and I found the advice there to be fairly generic. It's not a bad book; as programming books go it's pretty well written and mostly manages to avoid coming off as dry and academic despite its subject matter.
But I just don't think it really adds much to the literature on either refactorings or design patterns. View 1 comment. Oct 16, Ronald Rajagukguk rated it really liked it. Personally I expect more the book, nevertheless it gave me quite an impression. The book gave a lot of code example but unfortunately some of them is unclear, which need me to stare at the code several minutes till I understand the author intention.
- 50 Ways to Wear a Scarf.
- Refactoring to Patterns?
- Essential Matlab for Engineers and Scientists.
- A Practical Field Guide for ISO 13485!
- Stop Tweeting Boring Sh*t: The New Rules of Work.
- AppleScript in a Nutshell.
Good book a software engineer who want to know design pattern deeper, but i don't recommend this book for beginner. Aug 31, Marko Kunic rated it it was amazing. This should for sure be your first book about patterns. I really enjoyed the approach in this book, it is very well explained. Joshua Kerievsky first shows the problem and then refactors the code step by step into a pattern.
Why did I enjoy the approach? Aug 28, Jordi Espasa Cusachs rated it it was amazing Shelves: essential , techie , professionalism. The book drives you into the world of patterns in a very didactic way. Easy to read, engages you to use the patterns and also, very important, when not to use it. Full of stories and real examples, it shows you the decision process to when to use a pettern or another, or not use it at all. Not using patterns is an enemy, overengineering is an enemy as well.
What Are The Goals Of This Book?
Oct 12, Kaloyan Roussev rated it it was amazing Shelves: programming. The more interesting version of "Design patterns" by GoF and a lightweight substitute of one third of "Agile software development - Patterns practices principles". The natural continuation of Fowler's "Refactoring". Refactoring is my favorite topic in Software Quality. This book has only made me an even a bigger Merciless Refactorer. I like the way Joshua put the focus on learning the problem and not the solution. Dec 12, Ahmed rated it it was amazing Shelves: software-engineering. Very interesting book, but in order to get the most benefits from it, you have to read the Refactoring book by Martin Fowler first.
Jun 14, Justin rated it really liked it Shelves: software. Kerievsky provides a succinct set of patterns with non-trivial examples for each. All developers should have this for reference. Jun 25, Paolo Bizzarri rated it it was amazing. Excellent book on refactoring and patterns. Very good examples. Always a pleasure to reread.
Tech Workshop: Refactoring to Patterns | Apium Academy
Nov 05, Madhur Ahuja rated it it was amazing Shelves: tech. May 17, Umut Salih rated it liked it. Nov 26, Marshall rated it really liked it Shelves: non-fiction , technology. This book is an excellent combination of Design Patterns and Refactoring. Rather than thinking of design patterns as things you cook into your program, which is what usually leads to "design pattern abuse," this book recommends you start with a simple design first, and evolve to design patterns if you start noticing "c This book is an excellent combination of Design Patterns and Refactoring.
Rather than thinking of design patterns as things you cook into your program, which is what usually leads to "design pattern abuse," this book recommends you start with a simple design first, and evolve to design patterns if you start noticing "code smells" that are ideally solved with them, unless you know without a doubt that you will need them. This book is organized exactly like Refactoring , and looks very simiilar in its layout. Unlike Refactoring , this book isn't quite so useful as a cookbook of common refactorings.
So, as the Afterword recommends, don't try so hard to get good at these refactorings. Instead, use it to understand the thought processes that lead to those refactorings. Don't memorize this book--"grok" it. The code samples in this book are perfect, short enough to be straightforward and concise, but real enough to not resort to "toy code. However, I wasn't so impressed with the "Mechanics" section of each refactoring.
They were very hard to follow, though I'm not sure how they can be improved, so it may just be a symptom of the complex nature of many of these refactorings, rather than a reflection on the author's explanatory abilities. Apr 09, Blair Conrad rated it it was amazing Shelves: integrated-bookmark , gift , reread , reference. A very good book, balancing the need to present useful refactorings against the risk of alienating readers with too-complicated refactorings. A A very good book, balancing the need to present useful refactorings against the risk of alienating readers with too-complicated refactorings.
Since each refactoring is small, it's less likely to go wrong. The system is kept fully working after each refactoring, reducing the chances that a system can get seriously broken during the restructuring. When a software system is successful, there is always a need to keep enhancing it, to fix problems and add new features. After all, it's called soft ware for a reason! But the nature of a code-base makes a big difference on how easy it is to make these changes. Often enhancements are applied on top of each other in a manner that makes it increasingly harder to make changes. Over time new work slows to a crawl.
To combat this change, it's important to refactor code so that added enhancements don't lead to unnecessary complexity. Refactoring isn't a special task that would show up in a project plan. Done well, it's a regular part of programming activity. When I need to add a new feature to a codebase, I look at the existing code and consider whether it's structured in such a way to make the new change straightforward. If it isn't, then I refactor the existing code to make this new addition easy.
By refactoring first in this way, I usually find it's faster than if I hadn't carried out the refactoring first. Once I've done that change, I then add the new feature. Once I've added a feature and got it working, I often notice that the resulting code, while it works, isn't as clear as it could be. I then refactor it into a better shape so that when I or someone else return to this code in a few weeks time, I won't have to spend time puzzling out how this code works.
When modifying a program, I'm often looking elsewhere in the code, because much of what I need to do may already be encoded in the program.
Mars Rover Kata - Refactoring to Patterns
This code may be functions I can easily call, or hidden inside larger functions. If I struggle to understand this code, I refactor it so I won't have to struggle again next time I look at it. If there's some functionality buried in there that I need, I refactor so I can easily use it. When I wrote the first edition of Refactoring, back in , there were few automated tools that supported Refactoring. Now many languages have IDEs which automate many common refactorings. These are a really valuable part of my toolkit allowing me to carry out refactoring faster.
But such tools aren't essential - I often work in programming languages without tool support, in which case I rely on taking small steps, and using frequent testing to detect mistakes.