Overuse
The second problem with the Observer pattern is the danger of overuse. We stated before that the Observer pattern is a great choice when the requirements of a method aren't completely known or are likely to change. While it is true that anything in a game can change, taking this to the extreme would create a project that is impossible to program in and that will never be completed. In the most extreme case, every object could be both a Subject and an Observer. Every method would be ultimately flexible because we could change everything about it at runtime. Every call would notify Observers, which in turn would notify more Observers.
Of course, no one would implement their engine to that extreme, but overuse of the Observer pattern ...
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