A rich set of base classes reside directly above the common language runtime in the .NET hierarchy. They are known as the Base Class Libraries (BCL), or sometimes the Framework class libraries (FCL). The BCL include classes, interfaces, and value types that expedite and optimize the development process and provide access to system functionality. To facilitate interoperability among languages, the .NET Base types are Common Language Specification (CLS) compliant, and can therefore be used from any programming language whose compiler conforms to the CLS. The .NET Framework types are the foundation upon which .NET applications, components, and controls are built. The .NET Framework includes types that perform the following functions: Build on the base data types and exceptions Perform I/O Access information about loaded types Invoke .NET Framework security checks Provide data access; rich, client-side GUI; and server-controlled, client-side GUI The BCL provide a rich set of interfaces, as well as abstract and concrete (non-abstract) classes. You can use the concrete classes as is, or, in many cases, derive your own classes from them. To use the functionality of an interface, you can either create a class that implements the interface or derive from one of the .NET Framework classes a class that implements the interface. The System namespace is the root namespace for fundamental types in the .NET Framework. This namespace includes classes that represent the base data types used by all applications: Object (the root of the inheritance hierarchy), Byte, Char, Array, Int32, String, and so on. Many of these types correspond to the primitive data types that your programming language uses. When you write code using .NET Framework types, you can use your language's corresponding keyword when a .NET Framework base data type is expected. Table 1.1 lists some of the value types the .NET Framework supplies, briefly describes each type, and indicates the corresponding type in Visual Basic, C#, and the Managed Extensions for C++. The table also includes entries for the Object and String classes, for which many languages have corresponding keywords. In addition to the base data types, the System namespace contains almost 100 classes, ranging from classes that handle exceptions to classes that deal with core runtime concepts, such as application domains and the garbage collector. The System namespace also contains many second-level namespaces. Table 1.2 shows the categories of functionality the System namespace covers, the second-level namespaces in each category, and a brief description of each namespace. Although many of the second-level namespaces contain other namespaces, only a few of the third-level namespaces are included in this table. Table 1.1. The .NET Framework TypesCategory | Class Name | Description | Visual Basic Data Type | C# Data Type | Managed Extensions for C++ Data Type | JScript Data Type |
---|
Integer | Byte | An 8-bit unsigned integer | Byte | byte | char | byte | | SByte | An 8-bit signed integer; not CLS compliant | Sbyte - No built-in type. | sbyte | signed char | SByte | | Int16 | A 16-bit signed integer | Short | short | short | short | | Int32 | A 32-bit signed integer | Integer | int -or- long | int | int | | Int64 | A 64-bit signed integer | Long | long __int64 | long | | | UInt16 | A 16-bit unsigned integer; not CLS compliant | UInt16 - No built-in type. | ushort | unsigned short | UInt16 | | UInt32 | A 32-bit unsigned integer; not CLS compliant | UInt32 - No built-in type. | uint | unsigned int -or- unsigned long | UInt32 | | UInt64 | A 64-bit unsigned integer; not CLS compliant | UInt64 - No built-in type. | ulong | unsigned __int64 | UInt64 | Floating point | Single | A single-precision (32-bit) floating-point number | Single | float | float | float | | Double | A double-precision (64-bit) floating-point number | Double | double | double | double | Logical | Boolean | A Boolean value (true or false) | Boolean | bool | bool | bool | Other | Char | A Unicode (16-bit) character | Char | char | wchar_t | char | | Decimal | A 96-bit decimal value | Decimal | decimal | Decimal | Decimal | | IntPtr | A signed integer whose size depends on the underlying platform (a 32-bit value on a 32-bit and platform a 64-bit value on a 64-bit platform) | IntPtr - No built-in type. | IntPtr - No built-in type. | IntPtr - No built-in type. | IntPtr | | UintPtr | An unsigned integer whose size depends on the underlying platform (a 32- bit value on a 32-bit platform and a 64-bit value on a 64-bit platform); not CLS compliant | UintPtr - No built-in type. | UintPtr - No built-in type. | UintPtr - No built-in type. | UintPtr | Class objects | Object | The root of the object hierarchy | Object | Object | Object* | Object | | String | An immutable, fixed-length string of Unicode characters | String | String | String* | String | Table 1.2. Functionality Provided by the System NamespaceCategory | Namespace | Functionality |
---|
Component model | System.CodeDom | Representation of the elements and structure of a source code document, and compilation and handling of such code | | System.ComponentModel | Implementation of components, including licensing and design-time adaptation | | Configuration System.Configuration Data System.Data | Retrieval of application configuration data Access and management of data and data sources | | System.Xml | Standards-based support for processing XML | | System.Xml.Serialization | Bidirectional object-to-XML mapping | Framework services | System.Diagnostics | Application instrumentation and diagnostics | | System.DirectoryServices | Access to the Active Directory of an Active Directory service provider, such as a Windows domain | | System.Management | Services and application management tools that work with the Web-Based Enterprise Management (WBEM) standards | | System.Messaging | Microsoft Message Queue (MSMQ) access and management, and the sending and receiving of messages | | System.ServiceProcess | Installation and execution of Windows-based service applications; does not access specific services, such as Active Directory or XML Web Services | | System.Timers | Event raising on an interval or more complex schedule | Globalization and localization | System.Globalization | Support for internationalization and globalization of code and resources | | System.Resources | Resource management and access, including support for localization | Net System.Net | Support for sending and receiving data over a network, including simple programming interfaces for common network protocols such as HTTP and SMTP | | Common tasks | System.Collections | Collections of objects, such as lists, queues, arrays, hash tables, and dictionaries | | System.IO | Basic data stream access and management, including file I/O, memory I/O, and isolated storage | | System.Text | Character encoding, character conversion, and string manipulation | | System.Text.RegularExpressions | Full regular expression support | | System.Threading | Multithreaded programming support, including locking and synchronization | Reflection | System.Reflection | Access to type metadata and dynamic creation and invocation of types | Rich, client-side GUI | System.Windows.Forms | Rich user interface features for Windows-based applications | Runtime infrastructure Services | System.Runtime.CompilerServices | Support for compilers that target the runtime | | System.Runtime.InteropServices | Support for interoperability with COM and other unmanaged code | | System.Runtime.Remoting | Support for creating tightly or loosely coupled distributed applications | | System.Runtime.Serialization | Object serialization and deserialization, including binary and SOAP encoding support | .NET Framework security | System.Security | Access to the underlying mechanisms of the .NET Framework security system, including policy resolution, stack walks, and permissions | | System.Security.Cryptography | Cryptographic services, including encoding and decoding of data, hashing, random number generation, message authentication, and formation of digital signatures | Web Services | System.Web | Support for Web server and client management, communication, and design. Provides core infrastructure for ASP.NET, including Web Forms support | | System.Web.Services | Client- and server-side support for SOAP-based Web services | |