The Common Language Specification


The Common Language Specification (CLS) is a subset of the Common Type System (CTS). It is a set of types that may be used in external calls in code that is intended to be portable. All of the standardized framework (described in Partition IV, including the Base Class Library, XML Library, Network Library, Reflection Library, and Extended Numerics Library) are intended to be used on any system running a compliant VES, and in any CLS-compliant language. Therefore, the framework follows the CLS rules, and all (well, almost all) the types it defines are CLS-compliant to ensure the broadest possible use. In the few cases in which types or methods are not CLS-compliant, they are labeled as such (that's one of the CLS rules), and they are intended for use by compilers and language runtimes rather than direct use by programmers.

Figure 1-2 shows the relationship of languages, the Common Type System, and the Common Language Specification. It illustrates examples of how two compliant languages, Fujitsu COBOL, and Microsoft Managed C++, use the CTS and CLS. One of the things it shows is that some aspects of both languages are not CTS compliant. It also shows that the Common Type System is too big for any single language.

Figure 1-2. Relationship of Languages, the CTS, and the CLS

graphics/01fig02.gif

The CLS is actually a set of restrictions on the CTS. The CLS defines not only the types allowed in external calls, but the rules for using them, depending on the goal of the user. There are three categories of those who might wish to comply with the CLS: frameworks, extenders, and consumers. Frameworks are libraries that are intended to be language- and system-independent. Extenders and consumers are both targeted at language developers. Consumers intend their languages only to use frameworks supplied by others. Extenders intend to extend their language define types based on base types, define language-based libraries, etc.

Information on the CLS is contained in Partition I (Chapter 2 of this book), in the following sections:

  • Section 7 is a discussion of frameworks, consumers, and extenders.

  • Section 8 describes CLS rules in the context of the CTS discussion because the CLS is a subset, with restrictions, of the CTS.

  • Section 10 explains name and type rules for the CLS.

  • Section 11 is a list of the CLS rules only.



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