The Framework Class Library

Many predefined classes are grouped into categories of related classes called namespaces. Together, these namespaces are referred to as the .NET Framework Class Library, or the FCL.

Throughout the text, using directives allow us to use library classes from the FCL without specifying their fully-qualified names. For example, an application includes the declaration

using System;

to allow an application to use the class names from the System namespace without fully qualifying their names. This allows you to use the unqualified class name Console, rather than the fully qualified class name System.Console, in your code. A great strength of C# is the large number of classes in the namespaces of the FCL. Some key FCL namespaces are described in Fig. 7.6, which represents only a small portion of the reusable classes in the FCL. When learning C#, spend a portion of your time browsing the namespaces and classes in the .NET documentation (msdn2.microsoft.com/en-us/library/ms229335).

Figure 7.6. FCL namespaces (a subset).

Namespace

Description

System.Windows.Forms

Contains the classes required to create and manipulate GUIs. (Various classes in this namespace are discussed in Chapter 13, Graphical User Interface Concepts: Part 1, and Chapter 14, Graphical User Interface Concepts: Part 2.)

System.IO

Contains classes that enable programs to input and output data. (You will learn more about this namespace in Chapter 18, Files and Streams.)

System.Data

Contains classes that enable programs to access and manipulate databases (i.e., organized collections of data). (You will learn more about this namespace in Chapter 20, Database, SQL and ADO.NET.)

System.Web

Contains classes used for creating and maintaining Web applications, which are accessible over the Internet. (You will learn more about this namespace in Chapter 21, ASP.NET 2.0, Web Forms and Web Controls.)

System.Xml

Contains classes for creating and manipulating XML data. Data can be read from or written to XML files. (You will learn more about this namespace in Chapter 19, Extensible Markup Language (XML).)

System.Collections

System.Collections.Generic

Contains classes that define data structures for maintaining collections of data. (You will learn more about this namespace in Chapter 27, Collections.)

System.Net

Contains classes that enable programs to communicate via computer networks like the Internet. (You will learn more about this namespace in Chapter 23, Networking: Streams-Based Sockets and Datagrams.)

System.Text

Contains classes and interfaces that enable programs to manipulate characters and strings. (You will learn more about this namespace in Chapter 16, Strings, Characters and Regular Expressions.)

System.Threading

Contains classes that enable programs to perform several tasks at the same time. (You will learn more about this namespace in Chapter 15, Multithreading.)

System.Drawing

Contains classes that enable programs to perform basic graphics processing, such as displaying shapes and arcs. (You will learn more about this namespace in Chapter 17, Graphics and Multimedia.)

The set of namespaces available in the FCL is quite large. In addition to the namespaces summarized in Fig. 7.6, the FCL contains namespaces for complex graphics, advanced graphical user interfaces, printing, advanced networking, security, database processing, multimedia, accessibility (for people with disabilities) and many other capabilities. The preceding URL for the .NET documentation provides an overview of the Framework Class Library's namespaces.

You can locate additional information about a predefined C# class's methods in the Framework Class Library Reference. When you visit this site, you will see an alphabetical listing of all the namespaces in the FCL. Locate the namespace and click its link to see an alphabetical listing of all its classes, with a brief description of each. Click a class's link to see a more complete description of the class. Click the Methods link in the left-hand column to see a listing of the class's methods.

Good Programming Practice 7 2

The online .NET Framework documentation is easy to search and provides many details about each class. As you learn each class in this book, you should review the class in the online documentation for additional information.

Категории