The following rules outline the naming guidelines for interfaces:
  • Name interfaces with nouns or noun phrases, or adjectives that describe behavior. For example, the interface name IComponent uses a descriptive noun. The interface name ICustomAttributeProvider uses a noun phrase. The name IPersistable uses an adjective.
  • Use Pascal case.
  • Use abbreviations sparingly.
  • Prefix interface names with the letter I, to indicate that the type is an interface.
  • Use similar names when you define a class/interface pair where the class is a standard implementation of the interface. The names should differ only by the letter I prefix on the interface name.
  • Do not use the underscore character (_).

The following are examples of correctly named interfaces.
public interface IServiceProvider
public interface IFormatable

The following code example illustrates how to define the interface IComponent and its standard implementation, the class Component.
public interface IComponent {
   // Implementation code goes here.

public class Component: IComponent {
   // Implementation code goes here.

Last edited Jul 15, 2010 at 2:37 PM by camalot, version 1