Common Language Runtime
CLR is the heart of .Net Framework.
CLR is one of the key components of .Net Framework. CLR is
the core runtime engine in the Microsoft .NET Framework for executing all kinds
of applications.
Execution environment for code written in .NET
Framework.
The CLR
is described as the "execution engine" of .NET. It is this CLR that
manages the execution of programs. It provides the environment within which the
programs run. The software version
of .NET
is actually the CLR version.
The CLR works with every language available for the
.NET Framework.
The CLR
is a multi-language execution environment. There are currently over 15
compilers being built by Microsoft and other companies producing code that will
execute in CLR.
But CLR is not a common compiler for all .NET compatible
languages.
We all
know that .Net framework supports 70+ languages. But, since CLR is mentioned as
the “execution engine” of .Net framework, it is not a common compiler for all
language that converts the source code of any language to Machine code or
Managed code.
Note: All
.Net compatible languages have their own compiler. (i.e.) all 70+ languages
have their own compiler.
Common Type System
CTS describes a set of types (Data Types) that can
be used in different .Net languages in common. (i.e), CTS ensures that objects written in different
.Net languages can interact with each other.
For Communicating between programs written in any
.NET complaint language, the types have to be compatible on the basic level.
The common type system supports two general categories of types:
Value types:
Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined, or enumerations.
Reference types:
Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates.
Common Language Specification
Common Language Specification is a sub set of CTS.
CLS specifies a set of rules that needs to be
adhered or satisfied by all language compilers targeting CLR.
CLS helps in cross language inheritance and cross
language debugging.
Common language specification rules:
It describe the minimal and complete set of features to produce code that can be hosted by CLR
It ensure that products of compilers will work properly in .NET environment
Sample rules:
Representation of text strings
Internal representation of enumerations
Definition of static members and this is a subset of the CTS which all .NET languages are expected to support.
Microsoft
has defined CLS which are nothing but guidelines that language to
follow so that it can communicate with other .NET languages in a
seamless manner.
Base Class Library
Also called as Framework Class Library.
BCL are similar to header file in other programming
languages.
BCL are set of predefined code available for all
languages supporting .Net Framework
Developers just need to import the BCL in their
language code and use its predefined methods and properties to implement common
and complex functions like reading and writing to file, graphic rendering,
database interaction, and XML document manipulation.
No comments:
Post a Comment