O'Reilly Book Excerpts: VB.NET Core Classes in a Nutshell
An Introduction to the .NET FCL, Part 2
In part two of this book excerpt series on the .NET Framework Class Library from O'Reilly's VB.NET Core Classes in a Nutshell, get an introduction to the .NET Framework Class Library (FCL).
The .NET Framework includes the .NET Framework Class Library (FCL), a vast collection of thousands of types (that is, of classes, interfaces, structures, delegates, and enumerations) that aim at encapsulating the functionality of core system and application services in order to make application programming easier and faster. There are classes that you can use to manipulate the file system, access databases, serialize objects, and launch and synchronize multiple threads of execution, to name just a few.
To make working with these classes easy, classes with similar functionality are grouped together in namespaces. Therefore, there is a namespace containing types for drawing, a number of namespaces for .NET remoting, etc. In fact, the "intrinsic" functions of the Visual Basic language (such as InStr, Len, and UBound) are implemented as class methods in the Microsoft.VisualBasic namespace. In total, the .NET FCL places more than 80 namespaces at your disposal.
The .NET FCL includes classes with the following functionality:
- Data type definition
Some members of the System namespace, such as the Object, String, Int32, and Single classes, form the data types used by Visual Basic .NET (as well as by other .NET languages that rely on the .NET Common Type System).
When an exception is generated, the CLR provides exception information to the Exception class (in the System namespace) or to one of the derived classes found throughout the .NET FCL.
- Events and event handlers
The signature of event handlers is represented by the EventHandler delegate (in the System namespace) or one of its derived delegates. The event information passed to an event handler is represented by the EventArgs class (in the System namespace) or one of its derived classes.
Attributes allow custom items of information about a program element to be stored with an assembly's metadata. Since this information becomes a permanent part of the program element's description, it is always available and can be used to modify the design time, compile time, or runtime behavior of a program element. Attributes are classes derived from the Attribute class (in the System namespace) or one of its derived classes found throughout the .NET FCL.
- Collections and data structures
The .NET FCL features a number of general-purpose and more specialized collection classes. The general-purpose classes include the Array class (in the System namespace) and the ArrayList and CollectionBase classes (in the System.Collection namespace). Specialized classes include the Stack class, a last-in, first-out structure, the Queue class, a first-in, first-out structure, in the System.Collection namespace, and the ListDictionary class, a linked list dictionary class, in the System.Collection.Specialized namespace.
- Control creation
The .NET FCL provides full support for custom Windows and web controls that integrate with design-time environments like Visual Studio through a number of classes, including the Container class in the System.ComponentModel namespace or the CollectionEditor class in the System.ComponentModel.Design namespace.
- Configuration settings
Using the .NET FCL, you have easy access to application configuration information from configuration files using classes such as AppSettingsReader and DictionarySectionHandler in the System.Configuration namespace. You can also access registry data using the Registry, RegistryHive, and RegistryKey classes in the Microsoft.Win32 namespace. Finally, you can access ActiveDirectory information using the members of the System.DirectoryServices namespace.
- Debugging, profiling, and diagnostics
The .NET FCL makes a large number of debugging, diagnostic, and informational classes available that can help in locating and fixing bugs, as well as in improving overall performance. These include the Debug, Debugger, EventLog, and PerformanceCounter classes in the System.Diagnostics namespace.
Pages: 1, 2