When your task is writing code that is simple to maintain and test, you strive away from tightly connected parts that know too much about each other. The four patterns that will be described in this chapter will help you write complex code that interacts in different ways but is not interconnected in all possible—and impossible—ways in an unmanageable mess.
Two patterns from this chapter, iterator and observer, are, in my opinion, the two most important patterns from the Gang of Four collection. If you incorporate only two patterns into your code, let them be these two! They both help with decoupling parts of code and programming to the interface, not the implementation; two guidelines that will help you write maintainable code.
That doesn't mean that you should ignore other patterns from this chapter, or from this book...