What is .net framework?

The .Net framework is a software development platform developed by Microsoft. The framework was meant to create applications, which would run on the Windows Platform. The first version of the .Net framework was released in the year 2000.
The version was called .Net framework 1.0. The .Net framework has come a long way since then, and the current version is 4.6.1. The .Net framework can be used to create both - Form based and Web based applications. Web services can also be developed using the .Net framework.
The framework also supports various programming languages such as Visual Basic and C#. So developers can choose and select the language to develop the required application. In this chapter, you will learn some basics of the .Net framework.
In this tutorial, you will learn-
·         What is the .NET Framework
·         Different versions of the .Net framework

The architecture of the .Net framework is based on the following key components;
Common Language Runtime(CLR) –Common Language Runtime is a heart of the .net framework. It actually manages the code during Execution. The Code that runs under the CLR is called "Managed Code". The code that is executed  under .net run-time gets benefits like cross language inheritance, cross language exception handling, enhanced Security, Versioning and development support, a simplified model for component interaction, debugging and Profiling services.
        CLR Managed Code Execution Process
           The Process of Compiling and executing managed code is given below:-

·  When you compile a program written in any of language that target CLR., the compiler translate it into Microsoft Intermediate Language (MSIL) or Intermediate Language (IL). It does not depend on Language and always get translated to IL, This ensures language Interoperability.
· In addition to translating the code into IL, Compiler also produces metadata about the program during the process of compilation. Metadata contains the description of the program such as Classes and interfaces, the dependencies etc.
·  The IL and the metadata are linked in an assembly.
·  The Compiler creates .EXE or .Dll File.
·  When you execute the .exe or .dll file, the code and all the other relevant information from the base class library is sent to the class Loader, who loads the code in memory.
· Before code gets executed, The Just-in-Time (JIT) compiler translates the code from IL to native code (machine code). CLR supplies a JIT compiler for each supports CPU architecture. During the process of compilation, the JIT compiler compiles only the code that is required during execution instead of compiling the complete IL code.
· During JIT Compilation, the code is also checked for type safety. Type Safety ensures that object are accessed in a compatible way. Type Safety also ensures that objects are isolated from each other and are therefore safe from any malicious corruption.
· After Converted to native code, converted code is sent to .net runtime manager.
· The .net runtime manager executed the code, while executed the code, a security check is performed to ensure that the code has the appropriate permission for accessing the available resources.

Features provided by CLR
Some of the features provided by the CLR are as follows:
·Automatic memory management: - The CLR provides the Garbage Collection feature for managing the life time of object. This relives a programmer from memory management task.
· Standard Type System: - The CLR Implement a formal Specification called the Common Type System (CTS). CTS is important part of rules that ensures that objects written in different language can interact with each other.
· Language interoperability: - It is the ability of an application to interact with another application written in a different programming language. Language interoperability helps maximum code reuse. The CLR provides support for language interoperability by specifying and enforcing CTS and by providing metadata.
· Platform Independence: - The Compiler compiles code language, which is CPU-independent. This means that the code can be executed from any platform that supports the .Net CLR.
· Security Management: - In .net platform, Security is achieved through the code access Security (CAS) model. In  the model, CLR enforces the restriction an managed code through the object called “permissions”. The CLR allows the code to perform only that task for which it has permissions. In other words, the CAS model specifies what the code can access instead of specifies who can access resources.
· Type Safety: - This feature ensures that object is always accessed in compatible ways. Therefore the   CLR will prohibit a code from assign a 10-byte value to an object that occupies 8 bytes.

Benefits of CLR 
  Followings are some of benefits of the CLR
· Performance improvement
· The ability to easily use components developed in other languages.
· Extensible types provided by library.
· New Language features such as inheritance, interfaces etc.
· Complete Object-Oriented design.
· Very Strong Type Safety.
· Use of delegates rather than function pointers for increased type safety and security.
 .
CTS: Common Type Specification:
CTS provide a standard that all the .net framework is follows when declaring and using type .the main benefit of CTS is that language interoperability (mean more than one language is communicating each other.
Eg:-To implement or see how CTS is converting the data type to a common data type, for example, when we declare an int type data type in C# and VB.Net then they are converted to int32. In other words, now both will have a common data type that provides flexible communication between these two languages.

Comments

Popular posts from this blog