.Net Framework

Basic architecture of the .Net platform. Description of the Framework and its main components: Languages, class library and CLR.

New Microsoft technology offers solutions to current programming problems, such as code management or programming for the Internet. To take full advantage of the features of .Net it is necessary to understand the basic architecture in which this technology is implemented and thus benefit from all the features offered by this new platform.

The .Net Framework is an infrastructure that brings together a whole set of languages ​​and services that greatly simplify application development. Through this tool, a highly distributed execution environment is offered, which allows the creation of robust and scalable applications. The main components of this environment are:

  • build languages
  • .Net Class Library
  • CLR (Common Language Runtime)

Currently, the .Net Framework is a platform not included in the different operating systems distributed by Microsoft, so it is necessary to install it prior to running programs created using .Net. The Framework can be downloaded for free from the official Microsoft website (see download link in the resources at the end).

The .Net Framework supports multiple programming languages ​​and although each language has its own characteristics, it is possible to develop any type of application with any of these languages. There are more than 30 languages ​​adapted to .Net, from the best known like C# (C Sharp), Visual Basic or C++ to other lesser known languages ​​like Perl or Cobol.

Common Language Runtime (CLR)

The CLR is the true core of the .Net Framework, since it is the execution environment in which the applications developed in the different languages ​​are loaded, extending the set of services offered by the standard Win32 operating system.

See also  Images in HTML

The development tool compiles the source code of any of the languages ​​supported by .Net into a single code, called intermediate code (MSIL, Microsoft Intermediate Language). To generate such code, the compiler relies on the Common Language Specification (CLS) which determines the rules necessary to create CLR-compatible MSIL code.

In this way, regardless of the development tool used and the language chosen, the generated code is always the same, since the MSIL is the only language that directly understands the CLR. This code is transparent to application development as it is automatically generated by the compiler.

However, the code generated in MSIL is not machine code and therefore cannot be executed directly. A second step is needed in which a tool called a JIT (Just-In-Time) compiler generates the actual machine code that runs on whatever platform the computer has.

In this way, with .Net a certain independence of the platform is achieved, since each platform can have its own JIT compiler and create its own machine code from the MSIL code.

JIT compilation is performed by the CLR as methods are called in the program, and the resulting executable code is stored in the computer’s cache, being recompiled only when there is a change in the source code.

.Net Class Library

When an application is being programmed, actions such as file manipulation, data access, knowing the state of the system, implementing security, etc. are often needed. The Framework organizes all the functionality of the operating system in a hierarchical namespace so that when programming it is quite easy to find what is needed.

See also  Problem and solution about Facebook Like

For this, the Framework has a universal type system, called the Common Type System (CTS). This system allows the programmer to interact with the types included in the Framework itself (.Net class library) with those created by himself (classes). In this way, the advantages of object-oriented programming are used, such as the inheritance of predefined classes to create new classes, or the polymorphism of classes to modify or extend existing class functions.

The .Net Framework class library includes, among others, three key components:

  • ASP.NET to build Web applications and services.
  • Windows Forms to develop user interfaces.
  • ADO.NET to connect applications to databases.

The way to organize the .Net class library within code is through namespaces, where each class is organized into namespaces based on their functionality. For example, to handle files, the System.IO namespace is used and if what is wanted is to obtain information from a data source, the System.Data namespace will be used.

The main advantage of .Net namespaces is that in this way you have the entire library of .Net classes centralized under the same namespace (System). Also, the same invocation syntax is used from any language, since the same class library applies to all languages.

assembled

One of the biggest problems of today’s applications is that in many cases they have to deal with different binary files (DLL’s), registry elements, open connectivity to databases (ODBC), etc.

To solve this, the .Net Framework handles a new concept called an assembly. The assemblies are files in the form of EXE or DLL that contain all the functionality of the application in an encapsulated way. Therefore the solution to the problem can be as easy as copying all the assemblies in the application directory.

See also  Attach Download Link in the body of an email in ASP

With assemblies, you no longer need to register your application components. This is because assemblies store within themselves all the necessary information in what is called the assembly manifest. The manifest collects all the methods and properties in the form of meta-data along with other descriptive information, such as permissions, dependencies, etc.

To manage the use that applications make of assemblies, .Net uses the so-called Global Assembly Cache (GAC). Thus, the .Net Framework can house in the GAC assemblies that can be used by several applications and even different versions of the same assembly, something that was not possible with the previous COM model.

Means:

.Net Framework Official Page

.Net Framework Download

Loading Facebook Comments ...
Loading Disqus Comments ...