DotNET(.NET) Architecture | DotNET(.NET) Components

.NET Architecture

.NET Architecture

.NET Components

The architecture of the .Net framework is based on the following key components; 

Common Language Runtime - The "Common Language Infrastructure" or CLI is a platform on which the .Net programs are executed. 

The CLI has the following key features: 

1. Exception Handling - Exceptions are errors that occur when the application is executed. 

Examples of exceptions are: 

  • If an application tries to open a file on the local machine, but the file is not present. 
  • If the application tries to fetch some records from a database, but the connection to the database is not valid.

2. Garbage Collection - Garbage collection removes unwanted resources when they are no longer required. 

Examples of garbage collection are: 

  • A Filehandle which is no longer required. If the application has finished all operations on a file, then the file handle may no longer be required. 
  • The database connection is no longer required. If the application has finished all operations on a database, then the database connection may no longer be required. 

3. Language - The first level is the programming language itself, the most common ones are VB.NET and C#. 

4. Compiler – There is a compiler that will be separate for each programming language. So underlying the VB.NET language, there will be a separate VB.NET compiler. Similarly, for C#, you will have another compiler. 

5. Common Language Interpreter – This is the final layer in .NET that would be used to run a .NET program developed in any programming language. So the subsequent compiler will send the program to the CLI layer to run the .NET application.

What is Garbage Collection and Why We Need It?

When you create any object in C#, CLR (common language runtime) allocates memory for the object from the heap. This process is repeated for each newly created object, but there is a limitation to everything, Memory is not unlimited and we need to clean some used space in order to make room for new objects, Here, the concept of garbage collection is introduced, Garbage collector manages the allocation and reclaiming of memory. GC (Garbage collector) makes a trip to the heap and collects all objects that are no longer used by the application and then makes them free from memory. 

".NET architecture with diagram"

"dotnet architecture"

"ado.net architecture"

".NET framework"

".NET architecture patterns"

"asp.net architecture"