Classes
The following rules outline the guidelines for naming classes: Ø Use a noun or noun phrase to name a class. Ø Use Pascal case. Ø Do not use a type prefix, such as C for class, on a class name. For example, use the class name FileStream rather than CFileStream. Ø Do not use the underscore character (_). Ø Occasionally, it is necessary to provide a class name that begins with the letter I, even though the class is not an interface. This is appropriate as long as I is the first letter of an entire word that is a part of the class name. For example, the class name IdentityStore is appropriate. Ø Exception class name should always be suffixed with “Exception”. Ø Where appropriate, use a compound word to name a derived class. The second part of the derived class's name should be the name of the base class. For example, ApplicationException is an appropriate name for a class derived from a class named Exception, because ApplicationException is a kind of Exception. Use reasonable judgment in applying this rule. For example, Button is an appropriate name for a class derived from Control. Although a button is a kind of control, making Control a part of the class name would lengthen the name unnecessarily. For example: Sign VerifiableStream ExternalContractException TransformationMatrix
|