Difference between revisions of "Cpp Coding Standards/DESIGN/DIP"
From Apache OpenOffice Wiki
m (added link) |
m (Cpp Coding Standards/Design/DIP moved to Cpp Coding Standards/DESIGN/DIP: simplicity) |
(No difference)
|
Revision as of 11:00, 13 April 2007
Dependency inversion principle (DIP):
- high-level modules should not depend on low-level ones. Instead, they should both depend on abstractions.
- abstractions should not depend on details, but details should depend on abstractions.
Implement DIP by using abstract interfaces (a class consisting of pure virtual functions only). Typically, provide a public virtual destructor to facilitate polymprphic deletion.
See the original article for further explanation.