Posts

Showing posts with the label Observer Pattern

Avoiding Circular Dependencies using Observer Patterns in C++

Image
The basic concept is when you want information stored in one object, called the Model (or subject) to be watched by other objects, called Views (or observers). When information changes in the Model, all views attached to the Model should be notified and their statuses updated accordingly. In simpler terms, class A needs to know about class B, and vice versa, but while avoiding circular dependencies while doing so.