Exam 70-553 - Implement .NET Framework interfaces to cause components to comply with standard contracts.
Here is the fourth installment of my notes on Exam 70-553:
Section 1
- Part 1
- Topic 4
- IComparable interface
- IDisposable interface
- IConvertible interface
- ICloneable interface
- INullableValue interface
- IEquatable interface
- IFormattable interface
Summary
The IComparable Interface defines how a class should implement a type comparison method. To implement this interface, you just need to provide a CompareTo method.
The IDisposable interface defines how a class should implement a method to release resources. To implement this interface you just need to provide a Dispose method.
The IConvertible interface defines how a class should implement methods to convert value or reference types to .Net CLR common types. To implement this interface you need to provide a number of methods like ToChar, ToDecimal, ToDateTime, etc. See the resources for a full list.
The ICloneable interface defines how a class should implement methods to create a clone of itself (Copy itself). To implement this interface you just need to provide a Clone method.
The INullableVaue interface defines how a class should implement methods to define a nullable value type. To implement this interface you just need to provide an IsNull method.
The IEquatable Interface defines how a class should implement methods to determine if another object is equal to itself. To implement this interface you just need to provide an Equals method.
The IFormattable interface defines how a class should implement methods to format the object into a string representation. To implement this interface you just need to provide a ToString method.
Other Resources & Links:
IComparable Interface
http://msdn2.microsoft.com/en-us/library/ey2t2ys5(en-US,VS.80).aspx
IDisposable Interface
http://msdn2.microsoft.com/en-us/library/aax125c9(en-US,VS.80).aspx
IConvertible Interface
http://msdn2.microsoft.com/en-us/library/tyz9cd4z(en-US,VS.80).aspx
ICloneable Interface
http://msdn2.microsoft.com/en-us/library/hdf3zaf2(en-US,VS.80).aspx
IFormattable Interface
http://msdn2.microsoft.com/en-us/library/bk5yxz0f(en-US,VS.80).aspx