Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

Basics of .NET and learning tutorials on CTS and CLS

CTS (Common types system): -

In .NET there are lots of languages like C#, VB.NET, VF.NET etc.  There can be situations when we want code in one language to be called in other language. In order to ensure smooth communication between these languages the most important thing is that they should have a common type system. CTS (Common types system) ensure that data types defined in two different languages get compiled to a common data type.

So “Integer” data type in VB6 and “int” data type in C++ will be converted to System.int32, which is data type of CTS. 

Note: - If you know COM programming, you would know how difficult it is to  interface VB6 application with VC++ application. As datatype of both languages did not have a common ground where they can come and interface, by having CTS interfacing is smooth.

CLS (Common Language Specification): -

CLS is a subset of CTS. CLS is a specification or set of rules or guidelines. When any programming language adheres to these set of rules it can be consumed by any .NET language.

For instance one of the rules which makes your application CLS non-compliant is when you declare your methods members with same name and with only case differences in C#. You can try this create a simple class in C# with same name with  only case differences and try to consume the same in VB.NET ,it will not work.

Also get to see online .NET Training at QuestPond video’s on IL code, CLR, CTS, CAS: -

Helpful Website Url
Share this article   |    Print    |    Article read by 3233 times
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers
Related Articles:
Related Interview Questions: