Portions of the CLI

112 • Primitive types Integer, String, etc. are defined at the runtime level. Components can easily pass instances of primitive types between each other because they all agree on how that data is formatted. • Complex types structures, classes, enumerations, etc. are constructed in a way that is defined at the runtime level. Components can easily pass instances of complex types between each other because they all agree on how complex types are constructed from primitive types. • All types carry rich type information with them, meaning that a component that is handed an object can find out the definition of the type of which the object is an instance. This is analogous to type libraries in COM, but the CTS is different because the type information is much richer and is guaranteed to be present.

3.2.1 Namespaces

Namespaces were introduced in Chapt er 2 as a way to group related types. They are mentioned again here because they arent just a Visual Basic .NET concept; they are also used by the CLR and by other languages that target the .NET platform. Its important to keep in mind that to the CLR, a namespace is just part of a fully qualified type name, and nothing more. See Sect ion 3.4.2 later in this chapter for more information.

3.3 Portions of the CLI

The CLI specification recognizes that the CLR cant be implemented to the same extent on all platforms. For example, the version of the CLR implemented on a cell phone wont be as versatile as the one implemented on Windows 2000 or Windows XP. To address this issue, the CLI defines a set of libraries. Each library contains a set of classes that implement a certain portion of the CLIs functionality. Further, the CLI defines profiles. A profile is a set of libraries that must be implemented on a given platform. The libraries defined by the CLI are: Runtime Infrastructure Library This library provides the core services that are needed to compile and run an application that targets the CLI. Base Class Library This library provides the runtime services that are needed by most modern programming languages. Among other things, the primitive data types are defined in this library. Network Library This library provides simple networking services. Reflection Library This library provides the ability to examine type information at runtime and to invoke members of types by supplying the member name at runtime, rather than at compile time. XML Library This library provides a simple XML parser. Floating Point Library This library provides support for floating point types and operations. 113 Extended Array Library This library provides support for multidimensional arrays. The profiles defined by the CLI at this time are: Kernel Profile This profile defines the minimal functionality of any system claimed as an implementation of the CLI. CLRs that conform to the Kernel Profile must implement the Base Class Library and the Runtime Infrastructure Library. Compact Profile This profile includes the functionality of the Kernel Profile, plus the Network Library, the Reflection Library, and the XML Library. It is intended that an implementation of the Compact Profile can be lightweight, yet provide enough functionality to be useful. Additional profiles will be defined in future versions of the CLI specification. Any given implementation of the CLI is free to implement more than the functionality specified by these minimal profiles. For example, a given implementation could support the Compact Profile but also support the Floating Point Library. The .NET Framework on Windows 2000 supports all the CLI libraries, plus additional libraries not defined by the CLI. Note that the CLI does not include such major class libraries as Windows Forms, ASP.NET, and ADO.NET. These are Microsoft-specific class libraries for developing applications on Windows platforms. Applications that depend on these libraries will not be portable to other implementations of the CLI unless Microsoft makes those class libraries available on those other implementations.

3.4 Modules and Assemblies