Understanding Common Language Specification (CLS)

Common Language Specification is a set of specifications to interoperate objects written in all languages in .Net Framework. These specifications are documented in the ECMA proposed standard document, “Partition I Architecture”. When your application wants to interact with objects that are written in different languages, those objects must expose the features that are common to all the languages they must interoperate with. This is where the Common Language Specification ensures language interoperability by defining a set of features that are available in wide variety of languages.

The Common Language Specification rules are almost similar to that of Common Type System, except that the rules for Common Language Specification are stricter than that of Common Type System. Moreover, Common Type System is just a basic infrastructure to define, declare, use, and manage types for Common Language Runtime to follow. On the other hand, Common Language Specification is a set of rules to enable the types, written in different languages, to interoperate with each other.

You can create or design your own class library using Common Language Specification. Moreover, you can use class library to make sure that Application Programming Interface (APIs) are callable from a wide variety of programming languages. But before including the features to create a class library, using Common Language Specification, you should follow two principal things. First, whether the features to be included in the class library enable the type of Application Programming Interface development appropriate to the managed space and secondly whether it is difficult for the compiler to expose those features.

Components that follow the Common Language Specification rules and use the features included in the Common Language Specification are said to be CLS-compliant components. The Common Language Specification compliance feature helps you determine whether your managed code conforms to the Common Language Specification. If it does then to what extent a given tool supports the development of managed code that uses Common Language Specification features. Moreover, all the names within a CLS-compliant scope must not be similar to each other, except when the names are indistinguishable and resolved through overloading.

“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2024 - All Rights Reserved.