|
In the earlier diagram we have seen how classic compilers
translate high-level source code keen on instructions the
computer be able to understand. With .NET, this picture
changes radically. .NET-compatible compilers do not interpret
source code into Win32 API calls, but quite translate this
high-level source code keen on a special transitional
language, Microsoft Intermediate Language (MSIL). The CLR
takes this intermediate language (IL) and converts it into
machine-specific information. A diagram of this procedure can
be seeing below:
Appreciate that the CLR to run
time Program pace only happens when you execute a program. The
compiler generates a file that contains MSIL. When this is
‘executed’ the MSIL is streamed to the CLR, which then
performs Just in Time (JIT) compilation, converting the IL to
instructions the computer can know. You have a running program
by the CLR!
The .NET Framework Classes
Recall that earlier to DOTNET, Windows applications make use
of the Win32 API, a huge collection of functions that
interrelated with the operating system to offer all types of
tasks graphical stuff, hardware information handling, and
OS-level tasks. So how does a .NET program interrelate with
the operating system? Luckily the Win32 API is a fad of the
past; .NET applications make use of the .NET Framework
classes, a large organized set of classes that allocate for
all the functionality a developer would still require.
Unlike the Win32 API, the .NET
Framework classes are properly organized in a hierarchical
system of namespaces. Each namespace can contain an unlimited
number of classes. For example, the base namespace, System,
hold classes these are used for the primitive data types:
System.Int32, System.Array, etc. The System.Data namespace
hold classes and namespaces connected to data access; the
System.IO namespace contains classes for file manipulation and
general input/output. There are literally hundreds of classes
in the .NET Framework, all properly organized by namespace. In
truth, you can simply make your possess classes and namespaces
for make use of in your .NET applications.
Observe that the .NET
Framework classes hold a class for each one primitive data
kind in the System namespace. .NET programming languages like
VB.NET, C#, JScript.NET, etc. necessity use these data types,
meaning that all data type is, essentially, a class. So, while
you do the following:
In VB.NET: Dim a as Integer
In C#: int a;
In JScript.NET: var a;
You are actually making an instance of a class System.Int32.
Since each programming language uses the similar data types
and works as of the similar set of classes, interoperability
between languages in a crack. There is a cause the CLR is
called the Common Language Runtime (CLR) each programming
language ends up producing MSIL, which is guaranteed to use
decided upon data types and work with classes in the .NET
Framework.
Addressing the Three Disadvantages
Let us get an instant to look back at our three previous
disadvantages inherent in a compile directly from source code
to machine code paradigm.
Three disadvantages as:
I. Specific Platform.
II. Untidy structure of the Win32 API.
III. Difficulty in language interoperability.
.NET addresses all of these
problems, kind of. The first disadvantage is no longer a
difficulty in theory only in actuality. That is in theory
Microsoft could harbor the CLR and .NET Framework classes to
any platform and operating system (OS), meaning the MSIL
created by VisualBasic.NET could be run at Linux pack. In
reality, though Microsoft has not until now made public any
such intention of porting the CLR to some platforms or OS. In
my opinion, I wouldn't be amazed to see such a port
ultimately. The language
interoperability matter is straightly addressed by the .NET
Framework together with classes for both primitive data types
and functions for functioning at the OS level. By need
programming languages to utilize the classes in the .NET
Framework, you can make IL that any .NET-compatible
programming language can impeccably use. Also, the .NET
Framework is making entirely of classes and these classes are
set into a hierarchy, creating them a lot easier to find out,
use and know than their Win32 API complements.
Till then we have experiential
the two main parts to .NET: the CLR and the .NET Framework
classes. We will inspect how and where ASP.NET fits keen on
the picture!
|