Home   Cover Cover Cover Cover
 

Features of .NET

Question: What are the main features of the .NET framework? Which of them resemble the Java environment, and which are new?

Answer: The .NET Framework consists of the Common Language Runtime (CLR) and the Base Class Library. While the class library supports application development (and also web services and ASP.NET), the CLR provides the infrastructure that is shared by all .NET programs. The most important features of this infrastructure are the following:

  • The Common Intermediate Language (CIL). Programs written in different languages can cooperate seamlessly under .NET, because they are translated to the same CIL code, which is then translated to machine code at load time (just in time compilation).


  • The Common Type System (CTS) defines a common layout and behavior of the data types (classes, interfaces, etc.) in all .NET languages. This guarantees interoperability.


  • Services. The CLR provides a set of services that are missing from Windows. These include garbage collection, CIL code verification, security management, versioning, exception handling, threading, reflection and many more.


  • Assemblies contain not only code but also metadata, which are used for dynamic loading of assemblies as well as for reflection. Assemblies also contain a version number, which eliminates the danger of "DLL hell". Assemblies are easy to install and to de-install, because they are self-contained and do not have to be registered in the Windows registry.

The CLR is similar to the Java Virtual Machine, which also offers garbage collection and bytcode verification. However, Java does not support versioning. Like in .NET, Java programs are compiled to bytecodes which are translated to machine code at run time. In contrast to .NET, Java programs are first started in interpreted mode. If a method has been executed for a certain number of times, it is translated to machine code. .NET does not need an interpreter. All .NET programs are translated to machine code before they are executed.

Java offers portability of Java programs across various machines and operating systems. This is not guaranteed in .NET. However, .NET offers interoperability between different programming languages under Windows. The Java vision is "one language on multiple platforms", while the .NET vision is "multiple languages on one platform".