Difference between revisions of "Cpp Coding Standards/ENC"
From Apache OpenOffice Wiki
m (Cpp Coding Standards/Encapsulation moved to Cpp Coding Standards/ENC: consistency) |
|
(No difference)
|
Revision as of 15:43, 22 May 2007
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