Design Patterns in Ruby (US | UK) is the first book entirely dedicated to the implementation of the most common Design Patterns in Ruby as defined by the Gang of Four (GoF). Design Patterns in Ruby is written by Russ Olsen, edited by Addison-Wesley and is a part of the Professional Ruby Series managed by Obie Fernandez. This series is without a doubt synonymous to quality and guarantee for those looking for a book on Ruby or Rails.
Compared to my last readings, this publication was decisively less time consuming. I finished the book in no more than a week, dedicating an hour a day in tram. On condition that you have a certain familiarity with Ruby and Object Oriented Programming, Design Patterns in Ruby is a quick and involving reading.
Structure
The book is divided in three parts.
The first part, Patterns and Ruby, is a quick introduction to the design patterns and the Ruby programming language. As I said before, you should not rely too much on the second chapter. A single section is not enough to demonstrate the power of the Ruby language.
The second part, Patterns in Ruby, is the heart of the book. Each chapter covers one of the different patterns originally discussed by the GoF, providing a brief introduction, practical examples of the Ruby implementation and a few real world examples, inspired by famous Ruby libraries such as Rails and URI. At the end of each chapter, a summarizing paragraph wraps up the most important Design Pattern elements.
The third part, Pattern for Ruby, takes into consideration three patterns not included in the original book but emerged with the introduction and the development of the Ruby language.
Design Pattern discussed
This is the list of all design patterns discussed in the book:
- Template
- Strategy
- Observer
- Composite
- Iterator
- Commands
- Adapter
- Proxy
- Decorator
- Singleton
- Factory
- Builder
- Interpreter
These are the Ruby-oriented patterns covered in the third chapter:
- Domain-Specific Language (DSL)
- Meta-Programming
- Convention Over Configuration
Requirements
As stated in the preface of the author, in order to read this book you don’t need to hold any particular competence either in Ruby or Design Pattern. Even so, you should have a certain familiarity with the dynamics of the object oriented programming. I confess to finding myself partially disagreeing. Tackling the reading in this book without a certain amount of knowledge of Ruby could prove itself as counter-productive, considering that some design patterns use characteristics like meta-programming, reflection, modules, symbols, Mixins, blocks, and procedures. While the previous can be considered common aspects in many languages, starting from symbols onwards, you find yourself entering in the Ruby world.
The second chapter of the book offers a brief introduction to Ruby, but these 30 minutes of reading are nothing compared with the experience you can learn with a day-by-day programming or a Ruby book such as the excellent Learn to Program or Programming Ruby, one of the most complete Ruby references.
You don’t need any specific Design Pattern knowledge in order to appreciate this book. I agree with the author in this case. It covers all Design Patterns from theory to the practical implementation providing you with a full overview of the subject.
In conclusion
Once more, the Addison-Wesley and the Professional Ruby Series completely met my expectations. I strongly suggest the book Design Patterns in Ruby (US | UK) to all those programmers who wish to improve their Ruby development knowledge and leverage their skills to an even more professional level. Design Patterns are an advanced and professional solution to the most common software development problems and should be part of every professional developer.
Russ Olsen had the ability to write an easily readable publication, without compromising the quality of the book. Each chapter is self-contained and they can be read in no specific order. If I must find a dislike, then I would say the price could be lower, compared to the average price of similar books. But you know, quality has its price.
Where to Find Design Patterns in Ruby
You can get a printed or Kindle copy at Amazon.com, Amazon.co.uk, or at your other favorite book seller.
Simone,
Thanks for the kind words. I agree with you that my quick introduction to Ruby will not, by itself, make a Ruby programmer of anyone. I do, however, think that the intro chapter could help someone without much background in Ruby to *understand* the book and to see why we are all so excited about Ruby. But perhaps I shouldn’t disagree with someone who says such nice things about my writing!
Thanks again
Russ
Hey Russ,
thanks for stopping by my website!
I’m quite sure that who’s going to buy and read this book is likely to know at least the basic features of Ruby. However, I agree with you that a small Ruby overview is better than no overview at all.
Again, excellent book!
[...] has been since I published my last book review on this blog. The main reason is that, in the last year, I haven’t spent much time reading books. Last [...]
[...] is the second Olsen’s book about Ruby. In 2007 he published Design Patterns in Ruby, an other great example of how common programming practices like Design Patterns apply to the Ruby [...]