The framework .NET is a Composant software which can be added to the Operating system Microsoft Windows. It can be downloaded on the site of Microsoft and is also partially provided in certain commercial variations.

Several languages are available such as the C# (mixture of C++ and Java), the J# (near of the Java, but noncompatible Java) and the Visual BASIC .NET. Thanks to the availability of the technical specifications, various actors are free to add the support for another language, or a traditional language (in particular Cobol, Pascal, FORTRAN, Eiffel, Ada) like ASP.NET. Moreover the language Python will be usable soon thanks to the project IronPython whereas is already thanks to the project Phalanger.

Microsoft also developed a version reduced of the framework for the development of applications for its operating system for personal assistants: compact .NET framework .

There exist also free implementations of dowry Net, in particular Mono and DotGNU.

Framework .NET is component a installable on the operating systems Microsoft Windows.

The purpose of it is to facilitate the task of the developers by proposing an approach unified with the design of Windows applications or Web, while introducing facilities for the development, the deployment and the maintenance of applications.

The framework manages all the aspects of the execution of the application:

  • it allocates the memory for and instruction the data storage of the program;
  • it authorizes or prohibits the rights of the application;
  • it starts and manages the execution;
  • it manages ré-allocation of the memory for the resources which are not used any more.

Therefore framework .NET is described as “managed” environment.

It is composed of two principal blocks: the CLR and the library of classes .NET.

CLR - Common Language Runtime

See also: Common Language Runtime

The CLR is with .NET what JVM is with Java, i.e. a virtual Machine, without which code execution .NET would not be possible. Contrary to its competitor, framework .NET was conceived to allow interworking between different languages.

Whatever the language used to write an application .NET, the code must be transformed into MSIL ( Microsoft Intermediate Language ). This intermediate code does not comprise any instruction relating to the material (i.e hardware) or the operating system. It cannot thus be carried out directly. In spite of that, one could completely imagine to write directly an application in IT, language which resembles the assembler, without passing by a language of last generation like C#.

The CLR is necessary to carry out the intermediate code. It is based on the CTS ( Common Type System ) and the CLS ( Common Language Specification ). It brings many functionalities as Garbage Collector (the memory used by the application during the execution is optimized), the BCL ( Base Class Library ), and the security system. Once the code present in the CLR, it finally could be compiled by the JIT Compiler ( Just in Time ) in language native of the machine.

There exist three types of JIT:

  • Pre-JIT : the whole code is directly compiled;
  • Econo-JIT : the code is compiled by parts, and the released memory if necessary;
  • Normal-JIT : the code is compiled only when it is necessary, but then is placed hides some to be able to be re-used.

Whatever the type of JIT, the goal are to accelerate the execution of the code by re-using the mask as soon as possible. To see this visually, it is very simple. It is enough to write a simple application ASP.NET ( Hello World for example). With the first execution, the code is compiled. Thereafter and as a long time as the application does not undergo modifications, the mask will be used, from where a speed of execution much faster as during the first execution.

The JIT provided by Microsoft produces obviously only native code Windows, but the specifications being available, it was a group of people having decided to carry .NET on Linux, giving rise to the free platform of development Mono.

Libraries of classes .NET

There are three layers with the top of the CLR, each one comprising of the classes bringing of the increasingly advanced functionalities.

Base Class Library

In the first layer the BCL is, gathering classes allowing handling of chains of text, the management of the inputs/outputs, the communications networks, the threads and the design of the user interfaces. These classes are similar to those present in the API Java developed by Sun. For example, the handling of the chains is available in the class String , in the two languages; the difference being that in Java there does not exist of basic type to handle the chains (one handles objects “String”), whereas in .NET, the type string (with “tiny) specifically was defined.

And XML Classes dated

The second layer is made up of two libraries of classes of access to the data. First of all, ADO.NET, rising on the basis of TEENAGER former ( ActiveX Dated Objects ) used by developers ASP, and giving access under format XML the interfaces of databases SQL Server, ODBC, OLE dB, Oracle and Sybase, and of course with files XML. XML Classes make it possible to handle data XML. One finds there for example the classes XSLT allowing the transformation of a document XML towards any type of another document. Another example, it is very easy to charge a document XML in a table, and vice versa, thanks to the subjacent XML.

XML Web Services, Web Forms, Windows Forms

The last layer, most raised, is used for the creation of Web Services, Web pages, and Windows applications. The two first form ASP.NET, there too a reference to the old Web computer programming language. When you visit Internet sites, you can notice the pages ending in .aspx which are Web pages written in .NET, while the pages written in ASP finish in .asp (to have fun one can modify very well the configurations of waiter IIS from Microsoft to modify the extension of files ASP.NET whereas it is not a general information).

Structure of an application .NET

The basic unit of an application .NET is called an assembly ( assembly ). It is about a unit of code, resources and metadata. An assembly is always accompanied by a proclamation ( assembly manifest ) which describes what it contains: name, version, types of exposed data, other assemblies used, safety specifications. An assembly is composed of one or more modules which contain the code.

Compilation and execution of an application .NET

Just like with java, when an application .NET is compiled, it is not compiled in binary code machine, but in a binary code intermediate MSIL. An application thus consists of a whole of assemblies contained in one or more achievable files or files DLL in MSIL. At least one of these assemblies must contain an entrance point in order to start the application.

When the execution of a program starts, the first assembly is charged in memory. The CLR starts by examining the permissions required by this assembly and compares them with the Security policy (security policy) of the system. Then, if the assembly is authorized to be carried out, a process is created to carry out the application. The first piece of code necessary to the execution is charged in memory and is compiled in native binary code by compiler JIT ( Just-In-Time , just in time). Once compiled, the code is carried out and stored in memory in the form of native code, guaranteeing thus that each portion of code is compiled only once during the execution of the application.

.NET 3.0

For .NET 3.0, to see WinFX

Conclusion

. Net is a platform standardized and with universal vocation. It facilitates " nettement" the development of applications for those which control POO, proposing a hierarchy of objects as well as a general harmonization of the API. But the generated programs require computers equipped with a software surcouche and thus in front of being increasingly powerful.

Random links:Frank Wall | Jdanov doctrines | Mogoro | Richard Sola | Valinda (California) | San_Jose,_la_Californie

© 2007-2008 speedlook.com; article text available under the terms of GFDL, from fr.wikipedia.org