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.
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
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:
These are the Ruby-oriented patterns covered in the third chapter:
- Domain-Specific Language (DSL)
- Convention Over Configuration
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.
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.