Difference between revisions of "Cpp Coding Standards/ENC"
From Apache OpenOffice Wiki
m |
m |
||
| Line 2: | Line 2: | ||
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 [[../META | META:HideInformation]]. | ||
---- | ---- | ||
| − | === | + | === Summary === |
| − | |||
==== PrivateData ==== | ==== PrivateData ==== | ||
Make all class member data private. | Make all class member data private. | ||
| Line 18: | Line 17: | ||
=== Related Rules === | === Related Rules === | ||
* [[../META#HideInformation | META:HideInformation]] | * [[../META#HideInformation | META:HideInformation]] | ||
| + | ---- | ||
| + | === Explanations === | ||
| + | |||
---- | ---- | ||
[[Category:Coding Standards]] | [[Category:Coding Standards]] | ||
Revision as of 18:10, 27 November 2006
Encapsulation
Information hiding in classes. These items are all implementations of the meta rule META:HideInformation.
Summary
PrivateData
Make all class member data private.
NoFriends
Don't use “friend” except for the classical cases like stream operators.
KeepInternals
Don't give out handles to class-internal data.
Protect
Make all functions only to be used by derived classes protected.