What Is the .NET Framework?


The .NET Framework has two main elements: a virtual machine called the Common Language Runtime (CLR) and the Base Class Libraries (BCL). When you program for .NET, your compiler doesn't generate machine code, the way it used to. It now generates Intermediate Language (IL), which looks a lot like assembly language, except that it's meant to be OS- and CPU-independent. You write code in a high-level language like C# or VB.NET, and the compiler turns your code into IL. The CLR then takes code in IL form and converts it to machine code, which it executes. The code that it generates is called managed code. It's managed code because the CLR controls all aspects of allocating memory, lifetime of objects, etc.

The idea is that later companies will write their own versions of the CLR for different operating systems. This is a strong possibility because Microsoft submitted the specification for the CLR to the standards committee ECMA. The Common Language Infrastructure (CLI) (ECMA-335) and C# Language Specification (ECMA-334) became ECMA standards in December 2001 and are available for download as PDF files from www.ecma.ch. Companies can use the ECMA specification to write their own versions of the CLR. At the time of this writing, Microsoft has shipped source code for a scaled-down Intel version and a scaleddown FreeBSD version of the CLR. So it's even mostly open source!

(There is another effort going on called the Mono Project [www.go-mono.com], an open-source effort to port the CLR to Linux and other platforms.)

The BCL is a set of classes and functions that enable you to talk to the operating system and to other technologies, such as XML, ASP.NET, and ADO.NET. The BCL eliminates the need to code to the Win32 API directly.

So Microsoft's goal with the .NET Framework is to get you to use the BCL instead of traditional Win32 APIs. This way, when vendors port the CLR to other platforms along with the BCL, your programs will work in other operating systems and other processors. The same will be true even within the Windows world when new flavors of Windows appear. For example, wouldn't it be nice to write one program that works equally well in Windows XP and Windows CE? To achieve that, at the end of 2002, Microsoft released a version of the CLR and BCL for Windows CE, called the Compact Framework.



C#
C# & VB.NET Conversion Pocket Reference
ISBN: 0596003196
EAN: 2147483647
Year: 2003
Pages: 198
Authors: Jose Mojica

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net