Summary
In this chapter, we have examined four more behavioral patterns. They are a bit more complex than the patterns from the previous chapter, but they also help a lot with organizing the code and are well worth your consideration.
The iterator pattern is well-known to Delphi programmers. Most of you know how to write a for..in loop, even though the implementation details hiding behind this construct may not be your biggest concern. In this chapter, we have also explored the other part of iterators, namely, how to use them as a tool for writing generic algorithms.
This chapter continued with the visitor pattern, which is in some aspects iterator's counterpart. Unlike the iterator, this pattern wasn't designed to walk over data structures, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access