The .NET Framework and the Common Language Runtime
The Microsoft .NET Framework is at the heart of the .NET strategy. This framework manages and executes applications and Web services, contains a class library (called the .NET Framework Class Library, or FCL), enforces security and provides many other programming capabilities. The details of the .NET Framework are found in the Common Language Infrastructure (CLI), which contains information about the storage of data types (i.e., data that has predefined characteristics such as a date, percentage or currency amount), objects and so on. The CLI has been standardized by Ecma International (originally known as the European Computer Manufacturers Association), making it easier to create the .NET Framework for other platforms. This is like publishing the blueprints of the frameworkanyone can build it by following the specifications.
The Common Language Runtime (CLR) is another central part of the .NET Frameworkit executes .NET programs. Programs are compiled into machine-specific instructions in two steps. First, the program is compiled into Microsoft Intermediate Language (MSIL), which defines instructions for the CLR. Code converted into MSIL from other languages and sources can be woven together by the CLR. The MSIL for an application's components is placed into the application's executable file (known as an assembly). When the application executes, another compiler (known as the just-in-time compiler or JIT compiler) in the CLR translates the MSIL in the executable file into machine-language code (for a particular platform), then the machine-language code executes on that platform. [Note: MSIL is Microsoft's name for what the C# language specification refers to as Common Intermediate Language (CIL).]
If the .NET Framework exists (and is installed) for a platform, that platform can run any .NET program. The ability of a program to run (without modification) across multiple platforms is known as platform independence. Code written once can be used on another type of computer without modification, saving both time and money. In addition, software can target a wider audiencepreviously, companies had to decide whether converting their programs to different platforms (sometimes called porting) was worth the cost. With .NET, porting programs is no longer an issue (once .NET itself has been made available on the platforms).
The .NET Framework also provides a high level of language interoperability. Programs written in different languages are all compiled into MSILthe different parts can be combined to create a single unified program. MSIL allows the .NET Framework to be language independent, because .NET programs are not tied to a particular programming language. Any language that can be compiled into MSIL is called a .NET-compliant language. Figure 1.2 lists many of the programming languages that are available for the .NET platform (msdn.microsoft.com/netframework/technologyinfo/overview/default.aspx).
.NET programming languages |
|
---|---|
APL |
Mondrian |
C# |
Oberon |
COBOL |
Oz |
Component Pascal |
Pascal |
Curriculum |
Perl |
Eiffel |
Python |
Forth |
RPG |
Fortran |
Scheme |
Haskell |
Smalltalk |
Java |
Standard ML |
JScript |
Visual Basic |
Mercury |
Visual C++ |
Language interoperability offers many benefits to software companies. For example, C#, Visual Basic and Visual C++ developers can work side by side on the same project without having to learn another programming languageall of their code compiles into MSIL and links together to form one program.
The .NET Framework Class Library (FCL) can be used by any .NET language. The FCL contains a variety of reusable components, saving programmers the trouble of creating new components. This book explains how to develop .NET software with C#.
Test Driving a C# Application
|