In last post we have seen history of DOT Net framework. Now it is time to see what actually this framework is and what its features are. Everything built is based on some architecture. On the same way framework have their own architecture. Let’s see DOT Net Framework Architecture In Detail.
What is the .NET Framework?
.Net framework is revolutionary platform that has been developed and upgraded by Microsoft time to time. This framework was target mainly for windows based application and web application. It have following features
- Platform for a Desktop and Web application developers.
- Support Multi language and cross language integration.
- It have integrated development environment tool developed by Microsoft for supporting development.
- It support drag and drop integration for various application or web based control.
- Provide managed code generation and language transportability.
- It provides prebuilt set of libraries and classes to support smooth and easy development.
Fist we need to understand what is known as DLL (Dynamic Link Library) HELL problem.
DLL HELL:
DLL HELL refers to the problem caused when multiple application try to access common DLL. Earlier windows do not support multiple version of same file. But various applications that have been compiled with different version need that specific version to execute itself properly.
So to come up with this problem .Net provides an operating system with global assembly catch (GAC). So on single computer there will be same DLL file with different version can exist. Global assembly catch is place where all DLL file are shared. When system install specific application on machine, system check for its version and its public key , and it’s language based on that create one strong name for the component. These components then get register in GAC repository and index by strong name. So there is no confusion regarding versioning. Whenever applications need to access that DLL then it will check for its indexed strong name. No 2 component can have same strong name. So each component has their unique strong name.
This is sure short question that comes in exam for students who are doing engineering where .Net is part of the syllabus. This architecture is very easy to remember guys. Hunting And Analyzing High CPU Usage In .NET Application
DOT Net Framework Architecture:
Image above shown is an entire DOT Net framework architecture. If we come top to bottom we can see following component:
DOT Net Supported Languages:
On the top of framework there are high level languages that developers use to develop desktop and web application. Since DOT Net support many languages like C,C++, C#(C sharp), Visual Basic, F#, Jscript and so on. It also supports cross language interpretability using Common Language specification (CLS) and Common Type System (CTS).
As you can see in above image it contains the following component:
Common Type System (CTS):
Common type system defines how types are declared, used and managed in the common language runtime. It also plays and important part in cross language integration. CTS perform the following function as follows:
- Define rules that language must follow that help to ensure that object written different languages can interact each other.
- It ensure cross language integration, type safety.
- It helps to trace syntax and compile time error.
- Also improve code execution.
Garbage Collector:
Garbage collector is most important part of DOT Net framework. As memory increase over the time programs size also tends to improve. It is always important to keep memory free for additional program to execute. Garbage collector is like demon program that have low priority and always runs in background. Main job as name suggest garbage collector. It check in the memory when any object do not have any reference in runtime it will remove that object from the memory and free up some space.
Not only has that but garbage collector also taken care when user exit the application it will remove that program from the memory. So user can have memory for other program that need to be executed.
MSIL (Microsoft Intermediate Language):
Before Going to the concept of MSIL you must know what the differences between Native Language and MSIL are:
Native Language:
Language that understood by targeting operating system to execute that program on machine known as native code. This code conversion is called code compilation. This code compilation is done by compiler. In DOT NET Frame work it is 2 stage processes. Fist program code get converted into MSIL And then compile by Just In Time Compiler.
MSIL
For security reason and language portability DOT framework convert the code into intermediate language called MSIL. That can be then converted to machine level language by Just In Time Compiler (JIT). Since Common language runtime provide many just in time compiler by using which it convert MSIL to machine level code.
Just In Time Compiler:
Just time compiler performs compilation job that convert MSIL to operating system (OS) specific code to run it on target machine. Only at this point operating system can execute the program on targeted machine.
Just In Time as the name suggest this compiler compile code each time and convert MSIL to native code.
Coed Manager:
Code manger invokes class loader for execution. There are 2 kinds of coding style supported by DOT Net framework
- Managed Code:
Managed code is the code that control and compiled by CLR. Any language that managed within DOT Net framework it is managed code. Advantage of manageable code CLR Have control over code so it can take an advantage of CLR functionality like managing memory, handling security, allowing across, language interportability. - Un Managed Code:
When code developed outside the .Net framework is called as UN managed code. Application that do not run under complete control of CLR. They cannot use advantage and functionality offered by CLR.
So we have seen what is DOT Net framework, It’s architecture, various components like Common Language Runtime, Common type system, Garbage collector, Managed unmanaged code, and so on. So you if you have any query then comment below. Stay tuned for next post. Thanks for reading.
EmoticonEmoticon