This is a fundamental OOD principle, with some surprising subtleties when using C++.
Another fundamental OOD principle that argues for using inheritance "hooks" and template-based classes.
Components should depend on abstractions, not other components.
Classic Factory structure,
Classic Factory creating polymorphic objects
Illustrates how to create instances of a polymorphic type with clients knowing only the base class and factory interfaces.
Object Factory Structure,
Object Factory Project
This project implements a factory that allows clients to use derived classes but only bind to their
abstractions. It also demonstrates the use of products with multiple interfaces.
Extensible Object Factory Structure,
Programming to Interface Project
This project implements a template-based "pluggable object factory" and shows how to access
members of a hierarchy through an interface.
Code Parser
Illustrates very extensible design using interfaces and object factory.
Programming to Interfaces Presentation,
pptx
Discusses interfaces, layers, factories, and breaking design, compile, and static link dependencies.
MakeDLL Structure,
MakeDLL: Dynamic Link Library Project
This project demonstrates that compile and static link dependencies can be broken by programming
to interfaces and using object factories.
DLLDemo-Protocol Project
Demonstrates how Dynamic Link Libraries are loaded implicitly and explicitly.
To build successfully you need to
build the libraries first, then the clients.
Dll Loader with hosted resource
Shows how a library can use resources provided by its host.
Another fundamental OOD principle that argues for partitioning interfaces.