.NET technology FAQ (2) ----- Basic terminology

xiaoxiao2021-03-06  63

2. Basic term 2.1 What is CLR?

CLR = Common Language Runtime-General Language Runture. The CLR is a set of standard resource collections, regardless of the programming language, all (theoretical) .NET programs can benefit from it. Robert Schmidt (Microsoft) lists the following CLR resources in his MSDN PDC # article: Object-oriented programming model (inheritance, polymorphism, abnormal processing, garbage collection) security model type system all .NET basic class Framework development, debugging and assessment tools and code management IL-machine language converter and optimizer These meaning are, in the .NET world, different programming languages ​​will be more equivalent to the past, although obvious Not all languages ​​support all CLR services. 2.2 What is CTS? CTS = CommON Type System-General Type System. It refers to a series of types that the .NET runtime is understood and then the .NET application can use. However, beware that not all .NET languages ​​will support all types in the CTS. CTS is a super-collection of CLS. 2.3 What is CLS? CLS = Common Language Specification - General Language Specification. It is a subset of a CTS that is expected to support all .NET languages. This idea is to let any programs that use the CLS-compatible type and the .NET program written in any language can be operated. It is theoretically to allow close interoperability between different .NET languages ​​- for example, allowing a C # class to be inherited from one VB class. 2.4 What is IL? IL = intermediate language language - intermediate language. Also known as MSIL. All .NET source code (using any language) is compiled into IL. The IL is then converted to a machine code in the installation point of the software. 2.5 What is C #? C # is a new language running in the .NET framework. In their "C # Introduction" white paper, Microsoft describes C #: "C # is a simple, object-oriented, and is a type of safe, modern programming language. C # (pronunciation is' c sharp" in C and C ') Firmly root into the tree in C and C , will soon be familiar with C and C programmers. C # help developers combine the high productivity of Visual Basic and C direct control capabilities. " "C #" is replaced with "java", you will find this statement is still correct :). 2.6 What is the meaning of "managed" in .NET category. The term "managed" has led to a lot of misunderstandings. It uses it in different places in .NET, it refers to different things that are different from each other.

Managed code:

.NET

The frame provides several core running services for programs that run on it.

-

For example, abnormal processing and security. In order for these services to work, the code must provide some information about the lowest level of runtime. Such code is called managed code.

By default, all

C #

,

Visual Basic.net

with

Jscript.net

The code is managed by the code. If not specified,

VS7 C

The code is not managed, but can switch through a command line

(/ COM )

Enable the compiler to generate managed code.

Managed data: means

.NET

The garbage collector assigned and recycled data.

C #

,

VB.NET

with

Jscript.net

Data is always managed. Even if used

/ COM

Switch, by default

VS7 C

Data is not managed, but you can use

__GC

The keyword specifies it as being managed.

Manage class: usually

C

of

Managed Extensions (ME)

The category involves it. use

ME C

When you can use

__GC

The keyword is specified as being managed. The name is actually, the memory occupied by the instance of this class is managed by garbage collector, but not so. This class has become a complete

.NET

Members of the group bring benefits and restrictions. One of the benefits is to obtain interoperability between classes written in other languages.

-

For example, one is managed

C

Class can inherit

VB

class. One of the limits is that the management class can only inherit a base class.

2.7

What is an image?

all

.NET

Both compilers produce special data defined in the modules they produce. These special data are packaged with modules

(

Subsequent modules are encapsulated into components

)

Can be called an image

Mechanism to access.

System.Reflection

The namespace contains classes that ask the module or components to ask them.

Use an image to access

.NET

Special data is used

ITYPELIB / ITYPEINFO

Come to visit

COM

The type library data is very similar, and the purpose of use is also similar.

-

For example, determine the data type size to schedule them between the context, the process, the boundary of the machine.

Image can also be used to dynamically call methods

(

See

System.type.invokememember

Even dynamic creation types at runtime

(

See

System.reflection.emit.Typebuilder)

.

转载请注明原文地址:https://www.9cbs.com/read-119089.html

New Post(0)