Friday 18 November 2016

.Net Framework and Development of .Net Framework

.Net Framework

  1. .Net Framework is a software required for .Net applications on any machine, which masks the functionalities of an operating system and executes the .Net languages compiled code i.e. CIL code under its control by providing the features like:
  • Portability (Platform Independency)
  • Security
  • Automatic Memory Management
     2. In case of platform dependent languages like C, C++ etc., the compiled code (Machine Code)
runs directly under operating system, whereas in case of platform independent languages of .Net, compiled code (CIL code) will run under the .Net’s framework as following:
Fig: .NET Framework
Note: Applications which directly runs under operating system are known as un-managed applications, whereas applications which runs under the .Net’s framework are known as managed applications.

Development of .Net Framework:

  1. Microsoft has started the development of .Net’s framework in late 90’s originally under the name NGWS (Next Generation Windows Systems).
  2. To develop the framework, first a set of applications have been prepared known as CLI (Common Language Infrastructure) specifications. 
  3. CLI specifications are open specifications standardized under ISO (International Standards Organisation) and ECMA (European Computer Manufacturer Association), giving a chance for everyone to develop the framework.
  4. The CLI specifications talks about four important things, like:
            a. CLS (Common Language Specifications)
            b. CTS (Common Type System)
            c. BCL (Base Class Library)
            d. VES (Virtual Execution System) or CLR (Common Language Runtime)

a. CLS (Common Language Specifications)

It is a set of base class rules, all the .Net languages has to adopt for inter-operating or communicating with each other, most importantly after compilation of any .Net language program, they should give the same output code i.e. CIL code, so that, if any two languages wants to inter-operate with each other, then compiled code mismatch will not occur.

b. CTS (Common Type System)

  • According to this, all languages of .Net has to adopt “Uniform Data Type Structure” i.e. similar data type must be same in size under all languages of .Net, so that, if any two languages wants to inter-operate with each other, size problems with data types will not come into picture.
  • As most of the .Net languages are extension to some existing languages like Cobol.Net extension to Cobol, VB.Net extension to VB etc.; the data type name will be different from language to language, but even if names are different, similar types will be uniform in size.
  • Any data type that is used in any .Net language once after compilation gets converted into IL types as following:
         C#.Net —> Compiled —> CIL Code
         int                                      Int 32
         float                                   Single
         bool                                   Boolean

         VB.Net —> Compiled —> CIL Code
         Integer                              Int 32
         Single                                Single
         Boolean                             Boolean
  • In IL format, all data type will be same, so when we want to consume the code of a .Net language from other .Net language, the data type of first language are first converted into IL types and then presented to the second language as its understandable data types only, as following:
         Integer (VB.Net) —> Int 32 (IL Types) —> int (C#)

         Integer (VB.Net) <— Int 32 (IL Types) <— int (C#)

Note: CLS and CTS are the foundation for Language Interoperability between .Net languages.

c. BCL (Base Class Library)

  • A library is a set of reusable functionalities. Each and every programming language have built-in libraries like header files in C, CPP; packages in Java etc.
  • Same as above, .Net languages are also provided with built-in libraries known as BCL. The speciality of these libraries are they can be consumed under any .Net language as following:
Fig: Base Class Libraries
Note: BCL are good example for language interoperability because all these libraries have been developed by using C# language and being consumed from all other .Net languages.

 d. VES (Virtual Execution System) or CLR (Common Language Runtime)

  • All .Net languages once after compilation will generate the same type of output code known as CIL code and this CIL code what we install on client’s machine for execution.
  • To run CIL code on any machine, first the machine should be installed with .Net framework software and inside of that framework we have the VES or CLR which converts CIL code into machine code according to Client’s Platform (Operating + Microprocessor), as following:
Fig: VES or CLR
  • The framework software is available separately for each operating system because framework is not Platform Independent.
Note: CLR or VES will provide Platform Independency or Portability to .Net applications


No comments:

Post a Comment