Microsoft’s NET is a software platform that is specially built for developers. The initial edition of the .Net framework 1.0, was released in 2002. .NET framework Architecture creates a great space for constructing and running codes written in various programming languages.
Table of Content
It is used to construct Form-based Web service programs. On the .Net system, several programming languages are accessible, with VB.Net and C# seeming to be the most popular .net programming languages. They are used by the .NET development companies to create programs for Windows and mobile devices. The .Net framework includes a variety of features and meets industry demands.
However, in this article, we will be shedding a light upon .NET Architecture and its components.
1. .Net Framework Architecture
Net framework is a type of programming paradigm that provides a controlled performance setting, production, and implementation in the most straightforward manner. In addition, the .Net Framework Architecture is a programming model for the .Net platform. It is built on the following fundamental components:
- 1. CLS- Common Language Specification
- 2. CTS- Common Type Specification
- 3. FCL- .Net Framework Class Library
- 4. CLR- Common Language Runtime
- 5. CLI- Common Language Infrastructure
Let’s discuss all of them in brief!
1.1 CLS- Common Language Specification
CLS or Common Language Specification is a collection of methods that define a .NET language. CLS is the abbreviation for applications built utilizing many programming languages, such as C# and VB.NET.
Class loader is invoked by the code management for execution. .NET offers two types of programming:
- Managed Code
- Unmanaged Code
Within your software’s domain, the resource is considered as a managed code and is the fastest. The code produced using the .NET framework is referred to as managed code. This code is performed directly by CLR using managed code execution. Program developed in any language supported by the.NET Framework is managed code.
Managed code utilizes the Common Language Runtime (CLR), which manages resources, handles privacy, permits cross-language debugging, etc. for your applications.
The code produced outside of the.NET Framework is referred to as unmanaged code. Unmanaged programs are those that don’t operate under the supervision of the Common Language Runtime (CLR). Particular languages, like C++, can be leveraged to create unmanaged apps that, for instance, utilize low-level operating system services. Unmanaged code includes compliance with the VB, ASP, and COM source code.
- Unmanaged code may consist of both source code and compilation code.
- Execution of unmanaged code is facilitated via wrapper classes.
- 2 categories of wrapper classes exist CCW (COM callable wrapper) and RCW (Runtime Callable Wrapper).
- The wrapper is used to conceal the differences between CCW and RCW.
1.2 Common Type Specification (CTS)
Common Type Specification (CTS) is an array of .NET types such as System.Int32, System.Decimal, System.Boolean, and other related classes. Developers are not needed to utilize these kinds directly. These are the components backing the particular data types given by each controlled language. Below is the C# and Visual Basic .NET code for defining an integer. Each syntax corresponds to a Sys.Int32 object.
//C#integer int nVar=0; ' VB..NET dim nVar as integer=0
Ideally, one should utilize the syntax of the programming language and not the object type, allowing .NET the freedom to pick the most suitable type and size for the operating system.
The common type specification is likely to be a pyramid with System.Object on the top.
There are different values and reference types for .NET types that are separated. Value types are taken from System.ValueType is the primary one while reference types are derived directly or indirectly.
Value types are objects with a brief lifetime that are created on the heap. In essence, reference types are pointers that are created on the controlled heap. The Garbage Collector governs the lifespan of reference types. Value types can be transformed to reference types and likewise using the boxing and unpacking operations, correspondingly. When a programmer has to modify an object’s memory, boxing is useful.
CTS’s services extend much beyond the specifications of standard data types. CTS facilitates type safety, improves language compatibility, facilitates the separation of application fields, and more. Throughout just-in-time compilation, type inspection guarantees that MSIL properly reads memory and verifies that no action is made to retrieve a memory that was not previously described in metadata. If that’s so, the program is classified as malicious software. CTS offers a shared type base for the .NET language, hence improving language interoperability.
Finally, .NET adds app domains, which are compact operations. App domains are subprocesses. Standard Win32 programs are less flexible and more costly than app domains. .NET must monitor application domains to ensure that they are respectful neighbors. Code validation, type safety, and CTS all contribute to the safety of application domains.
1.3 FCL- .Net Framework Class Library
The FCL comprises all class modules, services, and techniques that may be integrated with CLR. They are viable and also referred to as “Assemblies.” It is comparable to the header files in C or C++ and Java modules. The FCL includes many types of characters, calendars, and integers, among others. In addition, the class library includes APIs for accessing and editing files, database interfaces, and graphics.
There is, for example, a class library with several ways of managing all filesystems. It indicates that there is a method to read data from a folder. Similarly, there is a mechanism for writing text to a drive.
Typically, .NET applications are created in the C# or Visual basic programming languages. In addition, the code is merged into the language-neutral Common Intermediate Language.
1.4 CLR- Common Language Runtime
.NET Common Language Runtime is the primary main virtual machine (VM) component of the .Net framework. It offers the runtime environment for applications within the .NET framework. Thus, it facilitates the development process for its consumers. Also, it provides a handful of other offerings such as internet support, type-safety, waste control, endurance, etc. It is accountable for controlling the execution of .NET code regardless of the .NET programming language used.
1.5 CLI- Common Language Infrastructure
CLI or Microsoft intermediate language is a language-independent framework for the creation and execution of applications. It also offers functions for managing exceptions, garbage collection, privacy, etc.
The CLI possesses the following important attributes:
Handling Anomaly – Anomalies are faults or problems that occur during software operation.
The following are examples of oddities or exceptions:
- In the event that a program attempts to open a file that does not exist on the local system.
- In the event that the program attempts to get data from records, the database access becomes incorrect.
Garbage Collection – It is the activity of removing unneeded materials.
Examples of garbage collecting include the following:
- A file handle that is now obsolete. If all actions on a file have been finished by the program, the file handle could no longer be relevant.
- In addition, the database connection is no longer in use. If all data activities have been finished by software, the database connection could be useless.
Using a variety of languages:
Language – The first level contains the programming language, with VB.Net and C# being the most prevalent.
Compiler – The compiler present here may be distinct for each programming language. Therefore, the VB.Net programming language will have its own compiler. It is probable that C# programmers will have access to a second compiler.
The CLI is the final layer of the internet foundation. This would be advantageous for running any computing language-based .Net app. Therefore, the subsequent compiler will transmit the code to the CLI layer in order to execute the .Net application.
2. .Net Framework Design Principle
The .Net Framework is useful for developing web-based applications due to the following design concepts.
1. Interoperability – Net Framework has an extensive reverse ability. Imagine your own software created utilizing an older release of the. Net Framework, perhaps 2.0. And if you attempt to run the same program on a system with more advanced knowledge, it will fail, for example, 3.5. The application is operational. Microsoft guarantees that previous framework versions are more compatible with each new edition.
2. Portability – Applications developed on .Net Framework are compatible with all Windows platforms. Microsoft is also exploring collaborating with other operating systems.
3. Security – The .Net Framework possesses an appropriate security solution. A built-in security mechanism facilitates application validation and verification. Each program is able to clearly specify its security system and grant net architecture access permissions to codes or programs in execution.
4. Memory Management – The CLR performs all tasks and controls memory. The .Net Framework includes the ability to inspect resources that are not utilized by running programs. Then, you will generate the corresponding resources. This is performed by the “Garbage Collector” program, which is a component of the .Net Framework. Additionally, it operates at periodic intervals and remains to evaluate unused system resources and release them accordingly.
5. Simplified Deployment – .Net Framework additionally contains tools for packaging applications developed on .Net Framework. The client’s system can then receive packages and then these packages install the software immediately.
Microsoft has created the Net programming language. It was intended to enable the creation of Windows-compatible applications. Net may be utilized to develop Forms-based apps, Custom web applications, and Online services. On the Microsoft .Net foundation platform, a range of programming languages is accessible to developers. The two most prevalent are VB.Net and C#.
Along with the framework, in this article, we specifically focused on the .NET architecture. If you have any doubt, please drop your query in the comment box.