5 The Standard Libraries


The detailed content of each Library, in terms of the types it provides and the changes it makes to types in other Libraries, is provided in XML form. This section provides a brief description of each Library's purpose, as well as specifying the features of the CLI required by each Library beyond those required by the Kernel Profile.

ANNOTATION

The class libraries are also published in this series as the .NET Framework Standard Library Annotated Reference.


5.1 Runtime Infrastructure Library

The Runtime Infrastructure Library is part of the Kernel Profile. It provides the services needed by a compiler to target the CLI and the facilities needed to dynamically load types from a stream in the file format specified in Partition II, section 23. For example, it provides System.BadImageFormatException, which is thrown when a stream that does not have the correct format is loaded.

Name used in XML: RuntimeInfrastructure

CLI Feature Requirement: None

5.2 Base Class Library

The Base Class Library is part of the Kernel Profile. It is a simple runtime library for modern programming languages. It serves as the Standard for the runtime library for the language C# as well as one of the CLI Standard Libraries. It provides types to represent the built-in data types of the CLI, simple file access, custom attributes, security attributes, string manipulation, formatting, streams, collections, and so forth

Name used in XML: BCL

CLI Feature Requirement: None

ANNOTATION

The CLI specification requires that all string objects embed characters directly in the object at a constant offset from the start of the object. This requirement is not specified in the text of the five partitions, but it is implied by the definition of the System.Runtime.CompilerServices.RuntimeHelpers.OffsetToStringData property. This requirement restricts the flexibility by not allowing multiple strings to share a character array and identify the string by offset and length of a substring in that array. Figure 7-1 shows the required layout for three strings: "LAN", "LANGUAGE", and "AGE". It would be desirable to allow flexibility so that the implementation could choose between the layout of Figure 7-1 and the shared layout of Figure 7-2. The lack of such flexibility was noted during the work of the ECMA technical committee responsible for this standard, and the description of System.Runtime.CompilerServices.RuntimeHelpers.OffsetToStringData states that this property is deprecated.

Figure 7-1. String Objects with Private Copies of Character

graphics/07fig01.gif

Figure 7-2. Sting Objects with Shared Character

graphics/07fig02.gif


5.3 Network Library

The Network Library is part of the Compact Profile. It provides simple networking services, including direct access to network ports as well as HTTP support.

Name used in XML: Networking

CLI Feature Requirement: None

5.4 Reflection Library

The Reflection Library is part of the Compact Profile. It provides the ability to examine the structure of types, create instances of types, and invoke methods on types, all based on a description of the type.

Name used in XML: Reflection

CLI Feature Requirement: Must support Runtime Infrastructure; see Partition IV, section 5.1.

5.5 XML Library

The XML Library is part of the Compact Profile. It provides a simple "pull-style" parser for XML. It is designed for resource-constrained devices, yet provides a simple user model. A conforming implementation of the CLI that includes the XML Library shall also implement the Network Library (see Partition IV, section 5.3).

Name used in XML: XML

CLI Feature Requirement: None

5.6 Extended Numerics Library

The Extended Numerics Library is not part of any Profile but can be supplied as part of any CLI implementation. It provides the support for floating point (System.Single, System.Double) and extended-precision (System.Decimal) data types. Like the Base Class Library, this Library is directly referenced by the C# Standard.

NOTE

Programmers who use this library will benefit if implementations specify which arithmetic operations on these data types are implemented primarily through hardware support.


RATIONALE

The Extended Numerics Library is kept separate because some commonly available processors do not provide direct support for the data types. While software emulation can be provided, the performance difference is often so large (1,000-fold or more) that it is unreasonable to build software using floating point operations without being aware of whether the underlying implementation is hardware-based.


CLI Feature Requirement: Floating Point; see Partition IV, section 4.1.1.

5.7 Extended Array Library

This Library is not part of any Profile but can be supplied as part of any CLI implementation. It provides support for non-vector arrays that is, arrays that have more than one dimension, and arrays that have non-zero lower bounds.

CLI Feature Requirement: Non-vector Arrays; see Partition IV, section 4.1.2.



The Common Language Infrastructure Annotated Standard (Microsoft. NET Development Series)
The Common Language Infrastructure Annotated Standard (Microsoft. NET Development Series)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 121

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net