Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Daniel Solis - Illustrated C# 2010 - 2010.pdf
Скачиваний:
16
Добавлен:
11.06.2015
Размер:
11.23 Mб
Скачать

CHAPTER 1 C# AND THE .NET FRAMEWORK

The Common Language Infrastructure

Every programming language has a set of intrinsic types representing such objects as integers, floatingpoint numbers, characters, and so on. Historically, the characteristics of these types have varied from one programming language to another and from platform to platform. For example, the number of bits constituting an integer has varied widely depending on the language and platform.

This lack of uniformity, however, makes it difficult if we want programs to play well with other programs and libraries written in different languages. To have order and cooperation, there must be a set of standards.

The Common Language Infrastructure (CLI) is a set of standards that ties all the components of the

.NET Framework into a cohesive, consistent system. It lays out the concepts and architecture of the system and specifies the rules and conventions to which all the software must adhere. Figure 1-7 shows the components of the CLI.

Figure 1-7. Components of the CLI

Both the CLI and C# have been approved as open international standard specifications by Ecma International. (The name “Ecma” used to be an acronym for the European Computer Manufacturers Association, but it’s now just a word in itself.) Ecma members include Microsoft, IBM, Hewlett-Packard, Adobe, and many other corporations associated with computers and consumer electronics.

11

CHAPTER 1 C# AND THE .NET FRAMEWORK

Important Parts of the CLI

Although most programmers don’t need to know the details of the CLI specifications, you should at least be familiar with the meaning and purpose of the Common Type System and the Common Language Specification.

Common Type System (CTS)

The Common Type System (CTS) defines the characteristics of the types that must be used in managed code. Some important aspects of the CTS are the following:

The CTS defines a rich set of intrinsic types, with fixed, specific characteristics for each type.

The types provided by a .NET-compliant programming language generally map to some specific subset of this defined set of intrinsic types.

One of the most important characteristics of the CTS is that all types are derived from a common base class—called object.

Common Language Specification (CLS)

The Common Language Specification (CLS) specifies the rules, properties, and behaviors of a .NETcompliant programming language. The topics include data types, class construction, and parameter passing.

12

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]