Difference between revisions of "Cpp Coding Standards/ENC"
From Apache OpenOffice Wiki
m (Cpp Coding Standards/Topics/ENC moved to Cpp Coding Standards/Encapsulation: Improve Cpp_Coding_Standards structure.) |
|||
Line 1: | Line 1: | ||
− | + | Topic-Id: '''ENC''' | |
− | Information hiding in classes. These items are all implementations of the meta rule [[../ | + | |
+ | Information hiding in classes. These items are all implementations of the meta rule [[../Principles#Hide | PRINC:Hide]] - Hide Information. | ||
---- | ---- | ||
=== Summary === | === Summary === | ||
− | ==== | + | ==== Private Data <span id="PrivData">(PrivData)</span> ==== |
Make all class member data private. | Make all class member data private. | ||
− | ==== NoFriends ==== | + | [[/PrivData|Details]] |
+ | |||
+ | ==== 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]] |
+ | |||
+ | ==== 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. | ||
− | ==== Protect ==== | + | [[/Internal|Details]] |
+ | |||
+ | ==== Protect <span id="Protect">(Protect)</span> ==== | ||
Make all functions only to be used by derived classes protected. | Make all functions only to be used by derived classes protected. | ||
+ | |||
+ | [[/Protect|Details]] | ||
+ | |||
---- | ---- | ||
=== Related Rules === | === Related Rules === | ||
− | * [[../ | + | * [[../Principles#Hide |PRINC:Hide]] - Hide Information |
− | - | + | |
− | + | ||
---- | ---- | ||
[[Category:Coding Standards]] | [[Category:Coding Standards]] |
Revision as of 17:38, 29 November 2006
Topic-Id: ENC
Information hiding in classes. These items are all implementations of the meta rule PRINC:Hide - Hide Information.
Contents
Summary
Private Data (PrivData)
Make all class member data private.
No Friends (NoFriends)
Don't use “friend” except for the classical cases like stream operators.
Keep Internals (Internal)
Don't give out handles to class-internal data.
Protect (Protect)
Make all functions only to be used by derived classes protected.
Related Rules
- PRINC:Hide - Hide Information