Thursday, February 21, 2019

what is CLR,CTS,CLS

The Common Language Runtime (CLR) is the programming (Virtual Machine component) that manages the execution of programs written in any language that uses the .NET Framework, for example C#, VB.Net, F# and so on.


Function of CLR.


  • Convert code into CLI.
  • Exception handling
  • Type safety
  • Memory management (using the Garbage Collector)
  • Security
  • Improved performance
  • Language independency
  • Platform independency
  • Architecture independency.

Component of CLR
  • Class Loader

    Used to load all classes at run time.
     
  • MSIL to Native code

    The Just In Time (JTI) compiler will convert MSIL code into native code.
     
  • Code Manager

    It manages the code at run time.
     
  • Garbage Collector

    It manages the memory. Collect all unused objects and deallocate them to reduce memory.
     
  • Thread Support

    It supports multithreading of our application.
     
  • Exception Handler

    It handles exceptions at run time.


What is CTS and CLS:

C# has int Data Type and VB.Net has Integer Data Type. Hence a variable declared as int in C# or Integer in vb.net, finally after compilation, uses the same structure Int32 from CTS.

Note:

All the structures and classes available in CTS are common for all .NET Languages and the purpose of these is to support language independence in .NET. Hence it is called CTS.



CLS(Common language specification):

CLS stands for Common Language Specification and it is a subset of CTS. It defines a set of rules and restrictions that every language must follow which runs under .NET framework. 
























No comments:

Post a Comment