Naming Conventions

General Guidance

  • Use the camel case naming convention.
  • Makes names meaningful and descriptive of the role of the class.
  • Avoid overly long names.
  • Acronyms should be have only the first character upper-cased. MyJdbcUtils vs MyJDBCUtils
  • Collections should be plural nouns or end in "Collection". i.e Devices or DeviceCollection

Interfaces

  • Interface names should be descriptive of their responsibility.
  • Single method interfaces can usually be suffixed with "able" such as ICloneable, IPassivatable, etc.

Classes

  • Most class names should be nouns.
  • If implementing a single interface, base the name on that of its interface.
  • If a class is the only implementation of an interface available in the system, the class can begin with "Default" or end in "Impl".
  • A class which supplies or resolves another entity should be an XxxResolver, XxxProvider or XxxFactory
  • Objects which hold others allowing the retrieval later should be a "Repository" or "Registery"
  • Most other cases should have a noun as it's root where possible, IVehicle, IContentGenerator
  • If a class is involved with another either by servicing or modifying the another or is just intimately involved in some way, including the name of that other as part of the name is encouraged. Examples: RepositoryListener, CustomerDetails, FooRegistry,