Skip to content

.NET Framework Interfaces

by Alex Peck on July 1st, 2009

Interfaces define a common set of functionality which all classes that implement the interface must provide. For the purposes of the training course, six framework interfaces are relevant:

IDisposable Free up (primarily unmanaged) resources which a class instance is responsible for. This article describes how to correctly implement IDisposable.
IConvertable Convert the implementer’s value into a CLR type
ICloneable Create a new instance of a class based on an existing one. This is now deprecated because it was unclear whether it meant deep or shallow copy, as suggested by Eric Lippert here.
IComparable Implemented by types which can be sorted based on a single method, CompareTo. This determines whether objects are greater or less than each other.
IEquatable Determine whether implementing class instances are equal
IFormattable Convert the implementer’s value into a formatted string. Useful in conjunction with System.Globalization.CultureInfo
No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS