Interfaces

  • DO use PascalCasing.

  • DO name interfaces with adjective phrases, or occasionally with nouns or noun phrases.

  • DO prefix interface names with the letter I, to indicate that the type is an interface.

    // Descriptive noun
    public interface IShape
    {
    }
    
    // Noun phrase
    public interface IShapeCollection
    {
    }
    
    // Adjective
    public interface IGroupable
    {
    }
    
  • DO ensure that the names differ only by the I prefix on the interface name when you are defining a class–interface pair where the class is a standard implementation of the interface. Example: Component (class), IComponent (interface).

    public interface IComponent 
    {
    }
    
    public class Component : IComponent
    {
    }
    

Learn More