Chapter 13: Using Common Design Patterns
In the last chapter, you learned how best to handle change in your libraries. A couple of common changes are to implement new design patterns or to remove inappropriate design patterns. While design patterns are not as necessary in Ruby as they are in less powerful languages, they are still a useful tool to have in your toolbox. When dealing with design patterns, it is important to understand when it is useful to apply them, and when it is best to abstain from doing so. So in this chapter, you'll also learn when it is appropriate to use specific design patterns.
In this chapter, we will cover the following topics:
- Learning about the many design patterns that are built into Ruby
- Handling cases where there can be only one
- Dealing with nothing
- Visiting objects
- Adapting and strategizing
By the end of this chapter, you'll better understand design patterns that are built into Ruby, and how and why to implement...