. NET Platform Some concepts

Source: Internet
Author: User

1. What is the CLR

When the CLR (Common Language Runtime) travels in the common language, it is a "journey time" that can be used by multiple programming languages. The core capabilities of the CLR, such as memory management, assembly loading, security, exception handling, and thread synchronization, can be used by all languages that target the CLR. The CLR does not care what language developers use to program, as long as the compiler is oriented to the CLR, and all developers should use their own language that is most appropriate and familiar to program. All programming languages generate a managed module in the compilation that targets the CLR compiler. A managed module is a standard 32-bit Microsoft Windows Portable Execution Body (PE32) file, or a standard 64-bit Windows Portable pe32+ file that requires the CLR to execute.

2. Intermediate language

The code generated by the MSIL (intermediate language) code compiler when compiling the source code. At run time, the CLR compiles IL to compile the cost of the CPU instruction

3. Meta-data

Metadata is a binary block of data, consisting of several tables. These tables are divided into three categories: definition tables (definiton talbe), reference tables (reference table), and Manifest tables (mainfest table).

Common metadata Definition tables (when the compiler compiles the source code, anything that is defined by the code causes a record entry to be created in the table in the definition table):

Moduledef always contains a record entry that identifies the module.

Each type defined in the TypeDef module has a corresponding record entry in the definition table.

Each method defined in the MethodDef module has a corresponding record entry in the definition table.

Each field defined in the FieldDef module has a corresponding record entry in the definition table.

Each parameter defined in the ParamDef module has a corresponding record entry in the definition table.

Each property defined in the PropertyDef module has a corresponding record entry in the definition table.

Each event defined in the Eventdef module has a corresponding record entry in the definition table.

Common reference Metadata tables:

Each assembly referenced in the AssemblyRef module has a corresponding record entry in the table

Each type referenced by the ModuleRef module may be implemented by another PE module, and all of those modules have a record entry in the table

Each type referenced by a TYPEDEF module has a corresponding record entry in the table

Each member referenced by the MEMBERREF module has a corresponding record entry in the table

Inventory metadata table:

AssemblyDef If the module identifies an assembly, it contains a single record entry in the metadata table. The record entry lists the assembly name (without the path and extension), the version (Major,minor,build and revision), the language Culture (cultural), some flags, the hashing algorithm, and the publisher's public key.

FileDef each PE file and resource file that is part of the assembly has a corresponding record entry in the table.

Mainifestresourcedef each resource that is part of an assembly has a corresponding record entry in the table

Exportedtypesdef each public type that is exported from all the PE modules in the assembly has a corresponding record entry in the table.

4. Common type systems (Common type System)

The CTS defines a type library that is broadly similar to the type system, whether Visual Basic.NET or C #. So. NET abstracts the data types of various programming languages, there is the CTS. Although each programming language has its own type system, it will be converted to the CTS type after compilation. Programs written in different languages can be manipulated directly between each other. The integer of VB and C # System.Int32 all correspond to the System.Int32 type of CTS.

The CTS types fall into two main categories: reference types and value types, which can be converted to each other by boxing and unpacking. The CTS type eventually inherits from object.

5. Common Language Specification (Common Language specifiaction,cls)

In order to create types that are easily accessible from other programming languages, only those features that are determined by all other languages are selected from their own programming language, and Microsoft defines a common language specification (Common Language specifiaction,cls). It defines a minimum feature set in detail.

. NET Platform Some concepts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.