Summary

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.

Table 5.5. BCL Interfaces and Classes
NameDescription
IEnumerableRepresents enumerable object. Makes foreach keyword in C# work.
IEnumeratorRepresents enumerator object. Returned by the enumerable object via GetEnumerator method.
ICollectionRepresents a collection. Inherits IEnumerable.
IListRepresents a manageable collection. Inherits ICollection and IEnumerable.
ICloneableProvides the semantics of deep copy on an object.
ArrayListA class that stores weakly typed objects. Implements IList, ICollection, IEnumerable, and ICloneable.
BitArray, Queue, SortedList, Stack, StringCollectionVarious collection types.
CollectionBaseA helper class that can be inherited to create a strongly typed collection.
ArrayA class that represents an array of strongly typed items. Once allocated, the size cannot be changed.
IDictionaryRepresents a collection of key–value pairs.
HashtableDictionary holding key–value pairs.
IHashCodeProviderProvides a way to define your own hash code function.
IComparer, IComparableProvides a way to compare two objects.
SortedListSorted dictionary.
ListDictionaryAn efficient implementation of a dictionary useful for less than 10 items.
DictionaryBaseA helper class that can be inherited to create a strongly typed dictionary.
StreamAn abstract base class for reading and writing data.
FileStreamRead or write data from or to a file.
EncodingExposes various encoding classes as static properties.
StreamReader, StreamWriterRead or write data as characters and lines.
BinaryReader, BinaryWriterRead or write basic datatypes in binary format.
SerializableAn attribute that indicates that the object can be serialized.
ISerializableHelps in customizing serialization on an object.
IFormatterRepresents a formatter.
BinaryFormatterSerializes an object in binary format.
SoapFormatterSerializes an object in SOAP format.
XmlSerializerSerializes an object in XML format.
IFormattableProvides custom formatting to strings.
StringStores a string.
StringBuilderMutable 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.

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

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