Cpp Coding Standards/DESIGN/DIP

From Apache OpenOffice Wiki
< Cpp Coding Standards‎ | DESIGN
Revision as of 22:34, 7 January 2007 by Thorsten (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Personal tools