C.4. Naming C# interfaces

Interface identifiers should start with an 'I'. For example, ISerializable is preferable to Serializable as an interface name. Do not separate the 'I' from the remaining characters with an underscore – ISerializable is preferable to I_Serializable.

Unlike class identifiers (which should be noun phrases), interface identifiers can be either noun phrases or adjectives (phrases describing behavior). Examples of suitable adjectives include IFormatable and ISerializable.

It is okay to name interface/class pairs (a class that is meant to implement an interface) so that their names differ only by the 'I' suffix, especially if a noun phrase has been selected for the interface name. For example, the IComponent interface is expected to be implemented by the Component class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.102.69