The CLI specification defines a rich type system that far surpasses COM's capabilities. It's called the Common Type System (CTS). The CTS defines at the runtime level how types are declared and used. Previously, language compilers controlled the creation and usage of types, including their layout in memory. This led to problems when a component written in one language tried to pass data to a component written in a different language. Anyone who has written Visual Basic 6 code to call Windows API functions, for instance, or who has tried to pass a JavaScript array to a component written either in Visual Basic 6 or C++, is aware of this problem. It was up to the developer to translate the data to be understandable to the receiving component. The CTS obliterates this problem by providing the following features:
Portions of the CLIThe CLI specification recognizes that the CLR can't be implemented to the same extent on all platforms. For example, the version of the CLR implemented on a cell phone won't 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 CLI's 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 LibraryThis library provides the core services that are needed to compile and run an application that targets the CLI. Base Class LibraryThis 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 LibraryThis library provides simple networking services. Reflection LibraryThis 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 LibraryThis library provides a simple XML parser. Floating Point LibraryThis library provides support for floating point types and operations. Extended Array LibraryThis library provides support for multidimensional arrays. The profiles defined by the CLI at this time are: Kernel ProfileThis 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 ProfileThis 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. |
|
Infolink
Search This Blog
Jul 28, 2012
Common Type System (CTS)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment