Home > Articles > Programming > C#

  • Print
  • + Share This
This chapter is from the book

The .NET Framework Class Library (FCL)

.NET has an extensive library, offering literally thousands of reusable types. Organized into namespaces, the FCL contains code supporting all the .NET technologies, such as Windows Forms, Windows Presentation Foundation, ASP.NET, ADO.NET, Windows Workflow, and Windows Communication Foundation. In addition, the FCL has numerous cross-language technologies, including file I/O, networking, text management, and diagnostics. As mentioned earlier, the FCL has CLR support in the areas of built-in types, exception handling, security, and threading. Table 1.2 shows some common FCL libraries.

Table 1.2. Common .NET Framework Class Library Namespaces

System

System.Runtime

System.Collections

System.Security

System.Configuration

System.ServiceModel

System.Data

System.Text

System.Diagnostics

System.Threading

System.Drawing

System.Web

System.IO

System.Windows

System.Linq

System.Workflow.*

System.Net

System.Xml

The namespaces in Table 1.2 are a sampling from the many available in the .NET Framework. They're representative of the types they contain. For example, you can find Windows Presentation Foundation (WPF) libraries in the System.Windows namespace, Windows Communication Foundation (WCF) is in the System.ServiceModel namespace, and Language Integrated Query (LINQ) types can be found in the System.Linq namespace.

Another aspect of Table 1.2 is that I included only two levels in the namespace hierarchy, System.*. In fact, there are multiple namespace levels, depending on which technology you view. For example, if you want to write code using the Windows Workflow (WF) runtime, you look in the System.Workflow.Runtime namespace. Generally, you can find the more common types at the higher namespace levels.

One of the benefits you should remember about the FCL is the amount of code reuse it offers. As you read through this book, you'll see many examples of how the FCL forms the basis for code you can write. For example, you learn how to create your own exception object in Chapter 13, “Naming and Organizing Types with Namespaces,” which requires that you use the Exception types from the FCL. Even if you encounter situations that don't require your use of FCL code, you can still use it. An example of when you would want to reuse FCL code is in Chapter 17, “Parameterizing Type with Generics and Writing Iterators,” where you learn how to use existing generic collection classes. The FCL was built and intended for reuse, and you can often be much more productive by using FCL types rather than building your own from scratch.

Another important feature of the FCL is language neutrality. Just like the CLR, it doesn't matter which .NET language you program in—the FCL is reusable by all .NET programming languages, which are discussed in the next section.

  • + Share This
  • 🔖 Save To Your Account