C.4 Naming C interfaces


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.



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net