Difference between revisions of "Cpp Coding Standards/DESIGN"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Cpp Coding Standards/Topics/DESIGN moved to Cpp Coding Standards/Design: Improve Cpp_Coding_Standards structure.)
m
Line 3: Line 3:
 
----
 
----
 
=== Summary ===
 
=== Summary ===
==== NoCyclicDependencies ====
+
==== NoCyclicDependencies <span id="NoVirt">(NoVirt)</span> ====
 
Avoid cyclic dependencies.
 
Avoid cyclic dependencies.
  
==== DependencyInversionPrinciple ====
+
[[/NoVirt|Details]]
 +
 
 +
==== DependencyInversionPrinciple <span id="NoVirt">(NoVirt)</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 ====
+
==== NoPrematureGeneralization <span id="NoVirt">(NoVirt)</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 ====
+
==== GlobalDataInit <span id="NoVirt">(NoVirt)</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 ====
+
==== AvoidGlobalData <span id="NoVirt">(NoVirt)</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.
----
 
=== Explanations ===
 
  
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 12:38, 29 November 2006

Design

General design rules.


Summary

NoCyclicDependencies (NoVirt)

Avoid cyclic dependencies.

Details

DependencyInversionPrinciple (NoVirt)

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

NoPrematureGeneralization (NoVirt)

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

GlobalDataInit (NoVirt)

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 (NoVirt)

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.


Personal tools