This rule is Obsolete | |
Synopsis: | Accessor method names should correspond with the attribute being accessed |
Language: | C++ |
Severity Level: | 10 |
Category: | Naming |
Description: |
When a class needs to declare accessors the name of these accessors needs to correspond with the attribute being accessed, combined with Set or Get based on the type of operation being performed by the accessor. As an example: when a class holds attribute name, the internal representation of this name might be: CString m_sName; The accessors belonging to this attribute would be declared as follows: const CString& GetName() const; void SetName(const CString& rsName); The use of get and set methods is not encouraged. |