Friday 18 November 2016

What is .Net? Why .Net?

.Net is a product of Microsoft designed to be Platform Independent (Portable) and Object-Oriented (Security and Re-usability) which can be used in the development of various kinds of applications like:

  • Desktop Applications
  • Character User Interface (CUI)
  • Graphical User Interface (GUI)
  • Web Applications
  • Mobile Applications

To develop the above applications, we are provided with the following things using .Net:


Languages: C#, VB.Net, VCPP.Net, F#.Net, J#.Net, Cobol.Net, Pascal.Net, Fotran.Net.
Technologies: ADO.Net, ASP.Net.
Servers: Windows Server Operating System, Sql Server (Database), IIS (Web Server), Biz Talk Server: Share Point Server.

Features of .Net:

There are two features of .Net. Those are:
  1. Language Interoperability
  2. Platform Independency or Portability

  1. Language Interoperability:
a. As .Net is a collection of languages, programmers are given an option of developing their applications by using any language of their choice, but each and every language used as a separate language compiler for program compilation.

b. A program that is written by using a .Net language once after compilation generates IL code and if at all the same program is written by different .Net languages and compiled they also will generate the same IL code, so we call this IL code as CIL (Common Intermediate Language) or MSIL (Microsoft Intermediate Language), as following:

Fig: Language Interoperability
c. All object-oriented programming languages provide re-usability of code but only within that language, whereas .Net language provide cross language re-usability of CIL code i.e. the CIL code generated from one .Net language can be reused from any other .Net language in the future and we call this as Language Interoperability.

C# Source Code -> Compile -> CIL Code -> can be reused under any .Net language program

 VB Source Code -> Compile -> CIL Code -> can be reused under any .Net language program

 C++ Source Code -> Compile -> Object Code -> can be reused only under another C++ program

 Java Source Code -> Compile -> Byte Code -> can be reused only under another Java program

Note: If any two languages wants to interoperate with each other, they need to cross two hurdles:
  1. Mismatch in compiled code.
  2. Mismatch in data type.


    2. Platform Independency or Portability:
When we develop any application by using any .Net language, after compilation, CIL code is generated and this CIL code is what we install on the client’s machine for execution which gets converted into machine code of client’s platform (Operating System + Processor) with the help of a special component known as CLR (Common Language Runtime), as following:

Windows Machine:
CIL Code -> CLR -> Machine Code for Windows

 Linux Machine:
CIL Code -> CLR -> Machine Code for Linux

Mac Machine:
CIL Code -> CLR -> Machine Code for Mac
 
Note: To get the CLR code on any machine, we need to first install a software on it, known as .Net framework.



No comments:

Post a Comment