What are CTS, CLS, and CLR in. NET Framework?

Source: Internet
Author: User

Full name:
CTS is a common type system)
CLR is the common language runtime)
CLS is a common language specification)

All types can be declared in CTS. CTS defines the rules that must be followed by a set of language compilers to define, reference, use, and store reference types and value types. Therefore, objects written in different languages can interact with each other only when CTS is followed.

However, not all types can be used in all languages. To create components that can be accessed in all. NET languages, you must use Cls. With CLs, the compiler can check whether the code is valid according to CLS specifications.

Any language that supports. NET is not limited to the public function subset defined by Cls. Even with. net, you can still create components that cannot be used in different languages. That is to say, using. Net to support all languages is much easier than using COM. If you limit yourself to CLs, you can ensure that the component can be used in all languages. Third-party libraries may be limited to Cls to ensure that they can be used in all languages.

. NET framework is designed to support multiple languages. In the design of. net, Microsoft allows many compiler developers to build their own. NET language. Microsoft released VB. NET and managed.
C ++, C #, J #, and JScript. net. In addition, different developers have developed over 40 languages, such as COBOL, smalltalk, Perl, and Eiffel. Each language has its unique advantages and many different features. The compilers of these languages are extended to support. net.


Tip:

CLS is the minimum specification required by a language. If you restrict public methods to CLs, all languages that support. Net can use our class!

In. NET Framework, almost all (but not all) classes are CLS compatible. In the msdn documentation, incompatible classes and methods are particularly marked as incompatible, such as the uint32 structure in the system namespace. Uint32 indicates a 32-bit unsigned integer. Not all languages (such as Visual
Basic. Net or J #) both support unsigned data types, which are incompatible with Cls.

From: http://www.cnblogs.com/mountain-mist/archive/2009/08/05/1539447.html

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.