1.9 Microsoft’s .NET

In 2000, Microsoft announced its .NET initiative (www.microsoft.com/net), a broad vision for using the Internet and the web in the development, engineering, distribution and use of software. Rather than forcing you to use a single programming language, .NET permits you to create apps in any .NET-compatible language (such as C#, Visual Basic, Visual C++ and others). Part of the initiative includes Microsoft’s ASP.NET technology for building web-based applications.

1.9.1 .NET Framework

The .NET Framework Class Library provides many capabilities that you’ll use to build substantial C# apps quickly and easily. It contains thousands of valuable prebuilt classes that have been tested and tuned to maximize performance. You’ll learn how to create your own classes, but you should re-use the .NET Framework classes whenever possible to speed up the software-development process, while enhancing the quality and performance of the software you develop.

1.9.2 Common Language Runtime

The Common Language Runtime (CLR), another key part of the .NET Framework, executes .NET programs and provides functionality to make them easier to develop and debug. The CLR is a virtual machine (VM)—software that manages the execution of programs and hides from them the underlying operating system and hardware. The source code for programs that are executed and managed by the CLR is called managed code. The CLR provides various services to managed code, such as

  • integrating software components written in different .NET languages,

  • error handling between such components,

  • enhanced security,

  • automatic memory management and more.

Unmanaged-code programs do not have access to the CLR’s services, which makes unmanaged code more difficult to write.7 Managed code is compiled into machine-specific instructions in the following steps:

  1. First, the code is compiled into Microsoft Intermediate Language (MSIL). Code converted into MSIL from other languages and sources can be woven together by the CLR—this allows programmers to work in their preferred .NET programming language. The MSIL for an app’s components is placed into the app’s executable file—the file that causes the computer to perform the app’s tasks.

  2. When the app 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).

  3. The machine-language code executes on that platform.

1.9.3 Platform Independence

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 time and money. In addition, software can target a wider audience. Previously, companies had to decide whether converting their programs to different platforms—a process called porting—was worth the cost. With .NET, porting programs is no longer an issue, at least once .NET itself has been made available on the platforms.

1.9.4 Language Interoperability

The .NET Framework provides a high level of language interoperability. Because software components written in different .NET languages (such as C# and Visual Basic) are all compiled into MSIL, the components can be combined to create a single unified program. Thus, MSIL allows the .NET Framework to be language independent.

The .NET Framework Class Library can be used by any .NET language. The latest release of .NET includes .NET 4.6 and .NET Core:

  • NET 4.6 introduces many improvements and new features, including ASP.NET 5 for web-based applications, improved support for today’s high-resolution 4K screens and more.

  • .NET Core is the cross-platform subset of .NET for Windows, Linux, OS X and FreeBSD.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset