Chapter 19. Conclusion

We have come a long way in this book—from our modest beginnings in overriding methods in the Template Method pattern, all the way to dynamically loading classes by convention. During our journey we have seen that the duck-typed, dynamic nature of Ruby changes the way we solve many programming problems. If we need to vary an algorithm that is buried deep in the depths of some class, we might build a Strategy object, but then again we might just pass in a code block. Implementing patterns like Proxy and Decorator—the ones that rely most heavily on delegation—ceases being an exercise in cranking out boilerplate code. The dynamic and reflective features of Ruby let us embrace the idea of a factory while going beyond the inheritance-bound ...

Get Design Patterns in Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.