The Framework Class Library (FCL) is a collection of classes and other types (enumerations, structures, and interfaces) that are available to managed code written in any language that targets the CLR. This is significant, because it means that libraries are no longer tied to specific compilers. As a developer, you can familiarize yourself with the types in a library and be assured that you can use this knowledge with whatever .NET language you choose.
The resources within the FCL are organized into logical groupings called namespaces. For the most part, these groupings are by broad functionality. For example, types used for graphical operations are grouped into the System.Drawing and System.Drawing.Drawing2D namespaces; types required for file I/O are members of the System.IO namespace. Namespaces represent a logical concept, not a physical one.
The FCL comprises hundreds of assemblies (DLLs), and each assembly may contain multiple namespaces. In addition, a namespace may span multiple assemblies. To demonstrate, let's look inside an FCL assembly.
Figure 1-8 displays a portion of the output generated by using Ildasm.exe to examine the contents of the mscorlib assembly. Although this only a partial listing, you can see that mscorlib contains System, the preeminent namespace in .NET, which serves as a repository for the types that give .NET its basic functionality. The assembly is also home to the System.Collections namespace, which includes classes and interfaces used for manipulating collections of data.
Figure 1-8. Output from Ildasm shows the namespaces and types that comprise an assembly
Table 1-2 lists some of the most important namespaces in .NET. For reference, the last column in each row includes a chapter number in this book where you'll find the namespace(s) used.
Table 1-2. Selected FCL Namespaces
Contains the basic data types used by all applications. It also contains exception classes, predefined attributes, a Math library, and classes for managing the application environment.
System.Collections System.Collections.Specialized System.Collections.Generic
Interfaces and classes used to manage collections of objects. These collections include the ArrayList, Hashtable, and Stack.
System.Data System.Data.OracleClient System.Data.SqlClient System.Data.OleDb System.Data.Odbc
Classes used for database operations (ADO.NET). The client namespaces support Oracle and SQL Server, respectively; OledDb and Odbc define the data connection used.
Contains classes that can be used to trace program execution, debug, and work with system logs and performance counters.
System.Drawing System.Drawing.Drawing2D System.Drawing.Printing System.Drawing.Text
Provides graphics functionality for GDI+. These namespaces contain a class used for drawing as well as pens, brushes, geometric shapes, and fonts.
Contains classes that define culture-related information that affects the way dates, currency, and symbols are represented.
Provides file and data stream I/O. These classes provide a way to access the underlying file systems of the host operating system.
Classes that support network protocols and operations. Examples include WebRequest and WebResponse that request and fetch a Web page.
Contains types that permit the runtime inspection of metadata. The Emit namespace allows a compiler or tool to generate metadata and IL dynamically.
7, 15, App. B
Provides interoperability between managed and unmanaged code such as legacy DLLs or COM.
System.Security System.Security.Permissions System.Security.Cryptography
Classes used to manage .NET security. Defines classes that control access to operations and resources.
Classes that support .NET's regular expression engine.
Manages threading activites: thread creation, synchronization, and thread pool access.
System.Web System.Web.Services System.Web.UI System.Web.UI.WebControls System.Web.Security
The Internet-related classes referred to as ASP.NET. They manage browser-server communication requirements, manipulate cookies, and contain the controls that adorn a Web page.
Web.Services includes those classes required for SOAP-based XML messaging.
Web.UI includes classes and interfaces used for creating controls and pages that comprise Web forms.
16, 17, 18
Classes used to build Windows desktop GUI applications. Controls including the ListBox, TextBox, DataGrid, and buttons are found here.
Types for processing XML.
Namespaces provide a roadmap for navigating the FCL. For example, if your applications are Web based, you'll spend most of your time exploring the types in the System.Web.* namespaces. After you have learned the basics of .NET and gained proficiency with C#, you'll find that much of your time is spent familiarizing yourself with the built-in types contained in the Framework Class Library.