Difference between revisions of "Cpp Coding Standards/DESIGN"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
Line 1: Line 1:
== Design ==
+
Topic-Id: '''DESIGN'''
 +
 
 
General design rules.
 
General design rules.
 
----
 
----
 
=== Summary ===
 
=== Summary ===
==== NoCyclicDependencies <span id="NoVirt">(NoVirt)</span> ====
+
==== No Cyclic Dependencies <span id="CyclDep">(CyclDep)</span> ====
 
Avoid cyclic dependencies.
 
Avoid cyclic dependencies.
  
[[/NoVirt|Details]]
+
[[/CyclDep|Details]]
  
==== DependencyInversionPrinciple <span id="NoVirt">(NoVirt)</span> ====
+
==== Dependency Inversion Principle <span id="DIP">(DIP)</span> ====
 
Use the dependency inversion principle. Prefer to define functionality in abstract interfaces and to inherit from them. Avoid state in abstract classes.
 
Use the dependency inversion principle. Prefer to define functionality in abstract interfaces and to inherit from them. Avoid state in abstract classes.
  
==== NoPrematureGeneralization <span id="NoVirt">(NoVirt)</span> ====
+
[[/DIP|Details]]
 +
 
 +
==== No Premature Generalization <span id="PremGen">(PremGen)</span> ====
 
As a rule of thumb, don't generalize before the second occurrence and no later than the third.
 
As a rule of thumb, don't generalize before the second occurrence and no later than the third.
  
==== GlobalDataInit <span id="NoVirt">(NoVirt)</span> ====
+
[[/PremGen|Details]]
 +
 
 +
==== Global Data Initialization <span id="GlobInit">(GlobInit)</span> ====
 
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.
 
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.
  
==== AvoidGlobalData <span id="NoVirt">(NoVirt)</span> ====
+
[[/GlobInit|Details]]
 +
 
 +
==== Avoid Global Data <span id="NoGlob">(NoGlob)</span> ====
 
Minimize the use of global data. For objects in global scope that are meant to be local to a class' implementation use an anonymous namespace.
 
Minimize the use of global data. For objects in global scope that are meant to be local to a class' implementation use an anonymous namespace.
 +
 +
[[/NoGlob|Details]]
  
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 14:23, 29 November 2006

Topic-Id: DESIGN

General design rules.


Summary

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 a class' implementation use an anonymous namespace.

Details


Personal tools