Cpp Coding Standards/DESIGN

From Apache OpenOffice Wiki
< Cpp Coding Standards
Revision as of 09:03, 23 May 2007 by Np (Talk | contribs)

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

Design (DESIGN)

General design rules.

No Cyclic Dependencies (CyclDep)

Avoid cyclic dependencies. -> Details

Dependency Inversion Principle (DIP)

Use the dependency inversion principle. Prefer to define functionality in abstract interfaces and to inherit from them. Avoid state in abstract classes. -> Details

No Premature Generalization (PremGen)

As a rule of thumb, don't generalize before the second occurrence and no later than the third. -> Details

Global Data Initialization (GlobInit)

Avoid cross module dependencies when initializing global data. Never let a global object's initialization depend on another global object in a different compilation unit. -> Details

Avoid Global Data (NoGlob)

Minimize the use of global data. For objects in global scope that are meant to be local to the implementation of a class use an anonymous namespace. -> Details

Personal tools