Practical Object-Oriented Design in Ruby: An Agile Primer (Addison-Wesley Professional Ruby) 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
There is a newer edition of this item:
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
About the Author
- Publisher : Addison-Wesley Professional; 1st edition (September 15, 2012)
- Language : English
- Paperback : 272 pages
- ISBN-10 : 0321721330
- ISBN-13 : 978-0321721334
- Item Weight : 1.2 pounds
- Dimensions : 8.5 x 0.62 x 11 inches
- Best Sellers Rank: #494,120 in Books (See Top 100 in Books)
- Customer Reviews:
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Tip: Watching Sandi Metz' presentations at conferences which is readily available on YouTube is a good complementary material to this book.
On the other hand, for an experienced Ruby developer, this book can also be a little boring if you're already familiar with many of the ideas. You still gain better understanding of the concepts but it can feel a little slow.
I'm also not a fan of the Kindle format in general and this book is not an exception. I'm pretty sure the physical book has a much better formatting, but I try to avoid having too many physical books at home. If you're undecided between getting the physical or digital copy and you don't have a strong preference, get the physical book.
What was most interesting (and something you don't see in a lot of software book) was how Sandi describes how a senior software designer will make decisions, while considering the technical debt that comes with those decisions. I have been working in software for over 20 years and this is what I find is missing when it comes to a lot of books out there. There's the idealized view of what software is, and then there's reality. In "real life", you have a limited amount of time to do your job and you only have a portion of the real system requirements. The question is how do you create your software so that future refactoring will be easy... this is what design is all about. The best way to make sure your software is refactorable is through the "micro" level design decisions you make, it's by making sure that you have single responsibility classes, it's by reducing coupling, etc. (I don't know of any good software that came out of an ivory tower architecture, good architectures that I have seen usually migrate from bottom-up).
This book is bang on with regards to this. It goes over the "micro" level design decisions that you have to make. It gives practical tips on how and why you would make these decisions.
There's also a very good chapter on testing, which explains some of the problems you'll find testing with dynamic languages. I especially like the way Sandi describe the "false positive" that can happen in the BDD and TDD worlds. It's made very clear and I like the solution that she describes to this problem.
In the last couple of years, I have read a number of books on Ruby and Rails. There's two that stand out... Eloquent Ruby and this one. I would recommend this book to anybody starting out in Ruby (junior or senior).
One caveat though... The ideas described in this book can be applied to most dynamic languages but some of the concepts might be counterintuitive if you come from a statically typed language. (For example, the use of duck types is not something you see in Java for example. In static (compiled) languages, you are trained to extract interfaces and to make things as strongly types as possible. This doesn't make sense with dynamic languages).
In any case, I highly recommend the book.
I'm only two chapters in and I definitely feel as if this book has already paid itself off.
The book starts off with plenty of insight on OOP and delivers direct and immediately actionable insight.
Thank you Sandi Metz for this amazing book!
I paid for this book and was not compensated for this review.
This message was approved by me... Because I wrote it; just now.
The only real ding to the book is Chapter 8's references to Enumerable and Forwardable. Everything else in the book was either easy to read or well explained. These two characters seem to have slipped in without fanfare or explanation. I don't understand them and thus probably missed some of the book's goodness. Perhaps I'll get it later. I still rate this book a 5 star buy!
Unfortunately, with a codebase of any interesting size, those conventions aren't sufficient for preventing chaos. Huge helper files? Big junk drawer, er, lib directory? For projects that come in at that stage, I've started recommending that the developers all stop coding for a day and read Sandi Metz's book. Learning how to create the right objects that send the right messages is a crucial skill for moving your Rails app into the big time.
Sandi has an amazing way of picking out the parts of Design-with-a-capital-D that are actually useful in a modern agile process, while leaving aside the waterfall trappings that typically accompany them. If you've ever read an article about software design and thought, "That's a nice theory, but these people have no idea how modern software is actually written" - then this book is for you. It's what happens when design intersects practice.
Top reviews from other countries
Two of the really stand out moments in the book for me:
1. I have known about SRP and the act of assigning responsibilities to objects so this was not new, but in chapter 4 the emphasis is switched to the messages passing between objects and using this to drive out what objects are needed this was a real eye opener for me and has changed the way I go about designing software
2. Unit testing has always felt like a tricky balance between going overboard and creating unit tests that are so ingrained with how each object does it's work that making a change requires all the related tests to be changed which then leads to the other end of the spectrum were we are so burned by this that we start to leave out unit tests for fearing what will happen when we want to make a change to an objects behaviour. In chapter 9 the author writes what I would consider should be compulsory reading for anyone before embarking on using unit tests especially TDD/BDD to know from the start how to go about writing unit tests correctly.
If your worried about it using Ruby, don't be I come from a C# background and have never written a line of Ruby, it's such an expressive language it shouldn't matter what language background you come from you will get tremendous value from this book.
A focus on making the pieces of your app easy to change and reuse make this an extremely useful book for programmers of all levels.
This book has really helped me to step up my understanding of OOP and has opened my eyes to a number of concepts that I'd never considered that will greatly improve my code going forward.
Can't recommend this book enough.
This book will help you to: create designs using building blocks that have a single responsibility, minime dependencies in them, create flexible, trustworthy and re-usable interfaces, properly use inheritance and understand when you should do, and much more.
This book will help you realise why the gang of four patterns bring the qualities they do to the problems they were created to solve. You will understand the principles behind them.
Don't let the word "Ruby" in this book put you off. This book serves as general object oriented design book, and if you have experience in statically typed languages, it will also allow you to realise the extra constructs necessary on them to essentially achieve the same level of decoupling that Ruby naturally allows.
Easy to read. Good examples. Small, concise and straight to the point!
Written for Ruby - it is equally applicable to Python.
When to use duck typing or composition, dependency injection or mixins, etc.
The code samples are minimal, as is any practical application. So this is the opposite of a Cookbook, or Manual.
But having read plenty of those recently, I felt it was all the better for that.
A pleasure to read, I would recommend this book to anyone for the clarity of its walk through of OOP design approaches available in a Ruby / Python type of language.