ASP .Net Framework Architecture


Ifourtechnolab

Uploaded on Jun 7, 2019

Category Business

A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NET technologies, such as desktop applications and Web services.

Category Business

Comments

                     

ASP .Net Framework Architecture

  .NET iFroaumre Cwoonrsku alrtcahnitceycture   https://www.ifourtechnolab.com/aspdotnet-web-development Definition  A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NET technologies, such as desktop applications and Web services https://www.ifourtechnolab.com/aspdotnet-web-development Common Language Runtime(CLR)  Net Framework provides run time environment called Common Language Runtime (CLR), It provides an environment to run all the .NET Programs  The code which runs under the CLR is called as Managed Code  Language Compilers (e.g. C#, VB.NET, J#) will convert the Code/Program to Microsoft Intermediate Language (MSIL) intern this will be converted to Native Code by CLR https://www.ifourtechnolab.com/aspdotnet-web-development MSIL (Microsoft Intermediate Language) When we compile our .NET Program using any .NET compliant language like (C#, VB.NET, C++.NET) it does not get converted into the executable binary code but to an intermediate code, called MSIL It is language independent code When you compile code that uses the .NET Framework library The MSIL code is not specific to any operating system or to any language https://www.ifourtechnolab.com/aspdotnet-web-development JIT (Just-in-Time) When our MSIL compiled code needs to be executed, CLR invokes JIT compilers which compile the MSIL code to native executable code (.exe or .dll) for the specific machine and OS The just - in - time part of the name reflects the fact that MSIL code is only compiled as, and when, it is needed JIT compilers (as their name suggests) use MSIL code, which is independent of the machine, operating system, and CPU Three types JIT • Pre JIT - It converts all the code in executable code and it is slow • Econo JIT - It will convert the called executable code only. But it will convert code every time when a code is called again • Normal JIT - It will only convert the called code and will store in cache so that it will not require converting code again, Normal JIT is fast https://www.ifourtechnolab.com/aspdotnet-web-development CTS (Common Type Specification) It is a set of standards Defines the basic data types that MSIL understands. Each .NET compliant language should map its data types to these standard data types This makes it possible for the 2 languages to communicate with each other by passing/receiving parameters to/from each other For example, CTS defines a type Int32, an integral data type of 32 bits (4 bytes) which is mapped by C# through int and VB.Net through its Integer data type https://www.ifourtechnolab.com/aspdotnet-web-development CLS (Common Language Specification) Microsoft has released a small set of specification that each language should meet to qualify as a .NET Compliant Language It is a subset of CTS. All instruction is in CLS i.e. instruction of CTS is written in CLS CLS basically addresses to language design issues and lays certain standards like there should be no global function declaration, no pointers, no multiple inheritance https://www.ifourtechnolab.com/aspdotnet-web-development Managed Code The code that is written to target the services of the managed runtime execution environment such as Common Language Runtime in .NET Technology It runs under a Common Language Runtime cannot be accessed outside the runtime environment as well as cannot be called directly from outside the runtime environment It refers to a contract of cooperation between natively executing code and the runtime It offers services like garbage collection, run-time type checking, reference checking etc https://www.ifourtechnolab.com/aspdotnet-web-development Unmanaged Code It compiles straight to machine code and directly executed by the Operating System The generated code runs natively on the host processor and the processor directly executes the code generated by the compiler It is always compiled to target a specific architecture and runs on the intended platform If you want to run the same code on different architecture then you will have to recompile the code using that particular architecture Unmanaged executable files are basically a binary image, x86 code, directly loaded into memory All code compiled by traditional C/C++ compilers are Unmanaged Code COM components, ActiveX interfaces, and Win32 API functions are examples of unmanaged code https://www.ifourtechnolab.com/aspdotnet-web-development Assemblies When you compile an application, the MSIL code created is stored in an assembly It includes both executable application files that you can run directly from Windows without the need for any other programs (these have a .exe file extension), and libraries (which have a .dll extension) for use by other applications All the .NET assemblies contain the definition of types, versioning information for the type, meta-data, and manifest. The designers of .NET have worked a lot on the component (assembly) resolution There are two kind of assemblies in .NET • Private • Shared https://www.ifourtechnolab.com/aspdotnet-web-development Assemblies Private • Refers to the assembly that is used by a single application. Private assemblies are kept in a local folder in which the client application has been installed • Example You have created a DLL containing information about your business logic. This DLL can be used by your client application. In order to run the client application, the DLL must be included in the same folder in which the client application has been installed Public or Shared Assembly • Refers to the assembly that is allowed to be shared by multiple applications. A shared assembly must reside in Global Assembly Cache (GAC) with a strong name assigned to it • Example Created DLL needs to be reused in different applications. Therefore, instead of copying the DLL in every client application folder, it can be placed in the global assembly cache using the GAC tool. These assemblies are called shared assemblies https://www.ifourtechnolab.com/aspdotnet-web-development Garbage Collector(GC) CLR also contains Garbage Collector (GC) which runs in a low-priority thread and checks for un-referenced dynamically allocated memory space The garbage collector performs the memory copy function to compress the objects in the managed heap It divides the objects on the managed heap into three generations: 0, 1, and 2. Generation 0 contains recently created objects The garbage collector first collects the unreachable objects in generation 0. Next, the garbage collector compacts memory and promotes the reachable objects to generation 1 The garbage collection can explicitly release these system resources by providing the cleanup code in the Dispose method of the object https://www.ifourtechnolab.com/aspdotnet-web-development Thank You.. https://www.ifourtechnolab.com/aspdotnet-web-development