Difference between revisions of "Cpp Coding Standards/ENC"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
m
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Encapsulation ==
+
== Encapsulation (ENC) ==
Information hiding in classes. These items are all implementations of the meta rule [[../META | META:HideInformation]].
+
''Information hiding in classes. These items are all implementations of the meta rule [[../PRINC#Hide | PRINC:Hide]] - Hide Information.''
----
+
=== Rules ===
+
  
==== PrivateData ====
+
===== Private Data <span id="PrivData">(PrivData)</span> =====
Make all class member data private.
+
Make all class member data private. [[/PrivData|-> Details]]
  
==== NoFriends ====
+
===== No Friends <span id="NoFriends">(NoFriends)</span> =====
Don't use “friend” except for the classical cases like stream operators.
+
Don't use “friend” except for the classical cases like stream operators. [[/NoFriends|-> Details]]
  
==== KeepInternals ====
+
===== Keep Internals <span id="Internal">(Internal)</span> =====
Don't give out handles to class-internal data.  
+
Don't give out handles to class-internal data. [[/Internal|-> Details]]
 +
 
 +
===== Protect <span id="Protect">(Protect)</span> =====
 +
Make all functions only to be used by derived classes protected. [[/Protect|-> Details]]
  
==== Protect ====
 
Make all functions only to be used by derived classes protected.
 
----
 
=== Related Rules ===
 
* [[../META | META:HideInformation]]
 
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Latest revision as of 09:04, 23 May 2007

Encapsulation (ENC)

Information hiding in classes. These items are all implementations of the meta rule PRINC:Hide - Hide Information.

Private Data (PrivData)

Make all class member data private. -> Details

No Friends (NoFriends)

Don't use “friend” except for the classical cases like stream operators. -> Details

Keep Internals (Internal)

Don't give out handles to class-internal data. -> Details

Protect (Protect)

Make all functions only to be used by derived classes protected. -> Details


Personal tools