Sunday, 27 August 2017

Understanding the .NET Framework

Common Language Runtime

The Common Language Runtime (CLR) is a layer between an application and theoperating system it executes on. The CLR simplifies an application's design and reducesthe amount of code developers need to write because it provides a variety of executionservices that include memory management, thread management, component lifetimemanagement, and default error handling. The key benefit of the CLR is that ittransparently provides these execution services to all applications, regardless of whatprogramming language they're written in and without any additional effort on the part ofthe developer.
The CLR is also responsible for compiling code just before it executes. Instead ofproducing a binary representation of your code, as traditional compilers do, .NETcompilers produce a representation of your code in a language common to the .NETFramework: Microsoft Intermediate Language (MSIL), often referred to as IL. When yourcode executes for the first time, the CLR invokes a special compiler called a Just In Time(JIT) compiler, which transforms the IL into executable instructions that are specific tothe type and model of your system's processor. Because all .NET languages have thesame compiled representation, they all have similar performance characteristics. Thismeans that a program written in Visual Basic .NET can perform as well as the sameprogram written in Visual C++ .NET.

Common Type System

The Common Type System (CTS) is a component of the CLR and provides a common set of data types, each having a common set of behaviors. In Visual Basic, for example, the String data type maps to the CTS System.String class. Therefore, if a Jscript .NET client needs to communicate with a component implemented in VB .NET, the client doesn't have to do any additional work to exchange information because it's using a type common to both JScript .NET and VB .NET. The CTS eliminates many interoperability problems that exist outside .NET.  
              .NET programming languages take advantage of the CTS by enabling developers to use their language's built-in data types — the .NET compilers convert the native data types' into their equivalent CTS types at compile time. Developers can also use CTS types directly in their code.

.NET Class Library


In an earlier section, "Consistent programming models across programming languages,"the .NET Class Library was described as containing hundreds of classes that model thesystem and services it provides. To make the .NET Class Library easier to work with andunderstand, it's divided into namespaces. The root namespace of the .NET Class Libraryis called System, and it contains core classes and data types, such as Int32, Object,Array, and Console. Secondary namespaces reside within the System namespace.

Unifying components

Until this point, this covered the low-level components of the .NETFramework. The unifying components, listed next, are the means by which you canaccess the services the .NET Framework provides:-

§ ASP.NET
§ Windows Forms

0 comments

Post a Comment