Saturday, December 22, 2007
Welcome InformIT readers! You might also like to see my review of Eloquent Ruby. Enjoy!
UPDATE: If you like this review, and want to learn more, check out interview with author, Russ Olsen.
The Professional Ruby Series from Addison-Wesley is rapidly becoming a heavyweight in Ruby book circles. I just received a complimentary copy of Russ Olsen’s Design Patterns In Ruby from them, and it looks like a great addition to their, already solid, line-up of books.
Russ breaks the book into three parts: Patterns And Ruby, Patterns In Ruby, and Patterns For Ruby. I think this is a good division and provides good coverage. Part II makes up the bulk of the book, while Parts I and III combined take up about a third the total.
I really like the first chapter of Part 1, “Building Better Programs with Patterns”. I’m less sold on the second chapter, “Getting Started with Ruby”—if you’re putting together an advanced book on Ruby, including a tutorial chapter seems a bit silly.
Part III is presents three patterns (one to a chapter) for Ruby Development: DSLs, Meta-programming, and ‘Convention over Configuration’. I think the third is more of a Railsism than a Rubyism, but it’s certainly worth considering. Also in Part III are a short conclusory chapter and two appendices. Appendix A discusses installing Ruby (again, I’m not sure why this one was included) and Appendix B provides references to further information.
Since Part II is so large, I thought I’d hit it last. Its thirteen chapters cover fourteen of the patterns presented in the Gang of Four Book. In selecting these, Russ says he leaned toward those most useful in writing code and those that change most between the original and the Ruby implementation. The patterns covered in this book are: Template Method, Strategy, Observer, Composite, Iterator, Command, Adapter, Proxy, Decorator, Singleton, Factory Method, Abstract Factory, Builder, and Interpreter.
Each of the Patterns chapters in Parts II and III feature three sections that I really liked: ‘Using and Abusing Foo’, ‘Foo in the Wild’, and ‘Wrapping Up’. In addition to be a good unifying touch, these were a great overview of each of the seventeen covered patterns I especially enjoyed the ‘Foo in the Wild’ sections making use of existing Ruby and Rails code to show the pattern in use.
All in all, Design Patterns In Ruby is a really good book. I’m planning on spending a lot more time with it, and it looks to have a regular spot at my desk.