The BCL defines hundreds of useful interfaces and classes to boost a developer's productivity. In this chapter, we covered many important ones. Table 5.5 summarizes some of these interfaces and classes. As an exercise, I suggest that you cover the right-hand column and try to remember the idea behind each interface or class.
Name | Description |
---|---|
IEnumerable | Represents enumerable object. Makes foreach keyword in C# work. |
IEnumerator | Represents enumerator object. Returned by the enumerable object via GetEnumerator method. |
ICollection | Represents a collection. Inherits IEnumerable. |
IList | Represents a manageable collection. Inherits ICollection and IEnumerable. |
ICloneable | Provides the semantics of deep copy on an object. |
ArrayList | A class that stores weakly typed objects. Implements IList, ICollection, IEnumerable, and ICloneable. |
BitArray, Queue, SortedList, Stack, StringCollection | Various collection types. |
CollectionBase | A helper class that can be inherited to create a strongly typed collection. |
Array | A class that represents an array of strongly typed items. Once allocated, the size cannot be changed. |
IDictionary | Represents a collection of key–value pairs. |
Hashtable | Dictionary holding key–value pairs. |
IHashCodeProvider | Provides a way to define your own hash code function. |
IComparer, IComparable | Provides a way to compare two objects. |
SortedList | Sorted dictionary. |
ListDictionary | An efficient implementation of a dictionary useful for less than 10 items. |
DictionaryBase | A helper class that can be inherited to create a strongly typed dictionary. |
Stream | An abstract base class for reading and writing data. |
FileStream | Read or write data from or to a file. |
Encoding | Exposes various encoding classes as static properties. |
StreamReader, StreamWriter | Read or write data as characters and lines. |
BinaryReader, BinaryWriter | Read or write basic datatypes in binary format. |
Serializable | An attribute that indicates that the object can be serialized. |
ISerializable | Helps in customizing serialization on an object. |
IFormatter | Represents a formatter. |
BinaryFormatter | Serializes an object in binary format. |
SoapFormatter | Serializes an object in SOAP format. |
XmlSerializer | Serializes an object in XML format. |
IFormattable | Provides custom formatting to strings. |
String | Stores a string. |
StringBuilder | Mutable string class. |
At this point, you should be fairly comfortable in developing programs using the BCL classes. We will be using many of these classes in the rest of the book.
18.217.109.151