7.12. Framework Class Library Namespaces As we have seen, the FCL contains many predefined classes that are grouped into namespaces. Throughout the text, we have used Imports statements to specify the namespaces used in a program. For example, a program includes the declaration Imports System.Windows.Forms to specify that the program uses classes in this namespace, such as class MessageBox. This allows you to use the simple class name MessageBox, rather than the fully qualified class name System.Windows.Forms.MessageBox, in the code. A great strength of Visual Basic is the large number of classes in the FCL. Some key FCL namespaces are described in Fig. 7.9, which represents only a small portion of the reusable components in the FCL. Figure 7.9. 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., an organized collection 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 | Contains classes that define data structures for maintaining collections of data. (You will learn more about this namespace in Chapter 26, 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 concurrently, or 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.9, the FCL includes namespaces for complex graphics, Web services, printing, security and many other capabilities. You can locate additional information about a predefined FCL class's methods in the Visual Studio .NET documentation by selecting Help > Index. In the window that appears there will be an index to the left. Enter .NET Framework in the Filtered by drop-down list, and enter the name of the class in the Look for field. You will be provided with links for general information about the class or for a listing of the class's members. Good Programming Practice 7.2 | The Visual Studio .NET documentation is easy to search and provides many details about each class. As you learn a class in this book, you should read about the class in the online documentation. |
|