Factory Patterns in C++

In a nutshell, the factory design pattern enables the practitioner to create objects that share a common theme but without having to specify their exact classes. In essence the factory pattern is used to “Define an interface for creating an object, but let the classes that implement the interface decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.
Continue reading

Avoiding Circular Dependencies using Observer Patterns in C++

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. Continue reading