Вы находитесь на странице: 1из 33

.

NET Overview

.NET Overview

Main Menu 1 of 33
.NET Overview

Overview
 At the end of this chapter, the student will be able to
understand the origin of .NET, what it encompasses
and what functionality does the .NET framework
provides.

Main Menu 2 of 33
.NET Overview

Scope

 Introduction to .NET
 .NET Framework
 Architecture of .NET Framework
 Common Language Runtime (CLR)
 Advantages of .NET
 Effect of .NET on the End Users

Main Menu 3 of 33
.NET Overview

Introduction to .NET
 In the initial stages of Web development, people
used isolated PCs in order to connect to the Internet.
 But as the need arose, they moved from isolated PCs
to using both PCs and plethora of devices.
 .NET is Microsoft’s next generation revolutionary
new platform for Windows and Internet software
development, based on open Internet protocols and
standards.

Main Menu 4 of 33
.NET Overview

Introduction to .NET
 The overall vision of Microsoft .NET is to create a
common platform for building applications.
 . NET initiative is all about enabling data transfer
between networks, PCs and devices independent of
platforms, architecture and solutions.
 The developers have broad freedom to write their
applications in whatever programming language
they are comfortable with.

Main Menu 5 of 33
.NET Overview

Introduction to .NET
 Microsoft has shipped various different
programming languages within Visual Studio. NET,
but there are actually more than 20 languages in all
that are going to target the .NET framework.
 .NET initiative basically revolves around the .NET
Framework that encompasses execution platform.

Main Menu 6 of 33
.NET Overview

.NET Framework
 The .NET Framework provides the most important
functionality of integrating different programming
languages with each other.
 It allows the developers to work in the language they
want.
 It saves time, enables automatic transactions and
memory management

Main Menu 7 of 33
.NET Overview

Architecture of .NET Framework


 The major components
of the .NET Framework
can be better explained
with the help of the
given diagram:

Main Menu 8 of 33
.NET Overview

Architecture of .NET Framework


 Built on top of the operating system services is a
CLR, the heart of the .NET Framework.
 It manages the need of running code written in any
modern programming language.
 It supplies many services that help simplify the code
development and application deployment.

Main Menu 9 of 33
.NET Overview

Architecture of .NET Framework


 The framework also includes a set of unified class
libraries.
 They include the higher level services which include
the various programming models that provide
components and services for developing web sites
and web services.

Main Menu 10 of 33
.NET Overview

Architecture of .NET Framework


Common Language Runtime
 The CLR provides the execution environment for the
.NET Framework applications.
 It is a runtime that is usable by different and varied
programming languages.

Main Menu 11 of 33
.NET Overview

Architecture of .NET Framework


Unified Classes
 The classes of the .NET
Framework provide a
unified, object oriented,
and hierarchical set of
class libraries.
 Some of the services
provided by the Unified
Classes are shown in the
given figure

Main Menu 12 of 33
.NET Overview

Architecture of .NET Framework


 The figure in the previous slide shows a base set of class
libraries that facilitate many aspects of application
development such as user interfaces, data storage, and
input/output.
 These unified programming classes also provide support
for developing more traditional Windows-based
applications.

Main Menu 13 of 33
.NET Overview

Common Language Runtime


 CLR is a set of standard resources that any .NET
program can take advantage of, regardless of the
programming language.
 Thus, it makes different programming languages
more equal in capability.
 The CLR makes it easy to design components and
applications whose objects interact across languages.

Main Menu 14 of 33
.NET Overview

Common Language Runtime


 When CLR processes the code, it has no idea of the
programming language that was used to generate
that code.
 The code can be developed in any programming
language as long as the compiler used to compile the
code targets the CLR.
 The compiler just checks the syntax and ensures that
whatever the code is written makes sense; after that
the code is handled by the CLR.

Main Menu 15 of 33
.NET Overview

Common Language Runtime


Architecture of CLR
 It is very important to
understand the
architecture of the CLR

 A diagrammatic
representation is given
here:

Main Menu 16 of 33
.NET Overview

Common Language Runtime


Working of CLR
 The whole concept of the working of CLR can be broken
up into the following steps:
Processing of a single source code
• A single code is compiled by the compiler. After
compilation the compiled code is converted into the
EXE/DLL file and is ready to be executed.
• This is known as the “Managed Module”.
• Actually, this Managed Module is known as the
Assembly, which comprises of the Intermediate
Language (IL).

Main Menu 17 of 33
.NET Overview

Common Language Runtime


• IL is a CPU independent set of instructions that can be
efficiently converted to the native code. It includes
instructions for loading, storing, initializing and calling
methods on objects. Apart from this, it also includes
instructions for arithmetic and logical operations,
control flow, direct memory access, exception
handling, and such other operations.

Main Menu 18 of 33
.NET Overview

Common Language Runtime

Main Menu 19 of 33
.NET Overview

Common Language Runtime


• Before, the MSIL can be executed, it must be converted
by the Just In Time (JIT) compiler to native code.
• This JIT compiler is provided by the CLR, for each
supported CPU architecture.
• The compilation is done only once and the results are
cached for the further use.
• The CLR contains a number of JIT compilers, which
convert the IL into native code (binary code).

Main Menu 20 of 33
.NET Overview

Common Language Runtime


Concise Example
• A concise example is discussed below in order to know
what happens when a code is written.
• There is a C# code which displays “Hello World” on
being executed. The listing of the code is:
using System;
class a{
public static void main() {
Console.Writeline(“HELLO WORLD”);
}
}

Main Menu 21 of 33
.NET Overview

Common Language Runtime


 Open the Visual Studio
Command Prompt, and
compile the program.
 As the code is
compiled, it is converted
into an EXE/DLL file,
the output of which is
shown in the following
screen:

Main Menu 22 of 33
.NET Overview

Common Language Runtime


Processing of Multiple Codes
• when there is more than a single code, written in
multiple languages which has to be executed then the
concept and working of the CLR changes to a certain
extent.
• The CLR works with the help of Assemblies. This can
be explained with the help of the following example:

Main Menu 23 of 33
.NET Overview

Common Language Runtime


• If a programmer wants to write a code in C# which
displays “HELLO WORLD”.
• Another programmer wants to do the same thing in
some other language.
• In this case Multilanguage integration feature of the
CLR comes into action.
• When there are more than one Managed Modules then
a tool, commonly known as Assembly Linker, is used
to convert all these managed modules to the Assembly.

Main Menu 24 of 33
.NET Overview

Common Language Runtime


 This can be explained
clearly with the help of
the figure:
 Now, this assembly
which comprises of the
IL and the Metadata is
processed in the same
way as the single file
assembly is processed
upon by the CLR.

Main Menu 25 of 33
.NET Overview

Advantages of .NET
The major advantages of .NET Framework can be
summarized as follows:
 Ability to use any programming language
 Well designed development tools
 Improved code design
 Support for loosely and tightly coupled architectures
 Legacy components and applications
 Easy Data Access

Main Menu 26 of 33
.NET Overview

Advantages of .NET
 Evidence Based Security
 Simplified application deployment
 Increased Reliability
 Improved Performance
 Unified Programming model

Main Menu 27 of 33
.NET Overview

Effect on the End Users


.NET has its implications on all sorts of software
professionals: Developers, Infrastructure Engineers
and other End Users. Here is a list of them:
 Programming Models: One of the key benefits of the
.NET Framework is that it provides a gradual
transition from simpler to much more complex
programming models.
 Reducing Barriers: programming for Internet
requires a completely different programming model.
The .NET Framework reduces many of these
differences. Main Menu 28 of 33
.NET Overview

Effect on the End Users


 Built-in Functionality: The .NET Framework
continues the tradition of providing more and more
built-in functionality.
 Easier Deployment: One of the Basic design goals of
Microsoft .NET Framework is to simplify the
installation and configuration of the software.

Main Menu 29 of 33
.NET Overview

Summary
 .NET is based on the Internet protocols and
standards.
 The programming language support of .NET allows
access to any other component regarding of the
language it was developed in.
 The objective of the .NET Framework is to simplify
the building of the Web Applications and Web
Services.
 The .NET Framework is divided into two major
components; Unified classes and Common
Language Runtime.

Main Menu 30 of 33
.NET Overview

Summary
 CLR provides the execution environment for .NET
Framework applications.
 IL is a CPU independent machine language.
 Metadata is produced by the compiler, which
describes the types in the code, and the definition of
each type.
 The CLR contains the JIT compiler which converts
the IL to the native code.

Main Menu 31 of 33
.NET Overview

Self Assessment
 Fill up the blanks:
 The heart of the .NET Framework is known as the
CLR
________________
 A major design goal of the .NET is to simplify
_______ the
configuration and installation of the software.
 Metadata
The __________reduces the use of Interface Definition
Language.
 The Runtime Environment is provided by the
CLR
___________ in the .NET Framework.
 The _________converts
JIT the IL into native code.

Main Menu 32 of 33
.NET Overview

Self Assessment
 State True or False:
 The class libraries of the .NET Framework provide a rich
built in functionality. (T/F) T
 The runtime fails to provide the services such as memory
management. (T/F) F
 In the .NET Framework, the code has to be compiled
every time it has to be executed. (T/F) F
 Value types are either built in value types or user defined
types. (T/F) T
 The basic idea behind the CLR was to allow the
developers to write less code and use more code. (T/F) T
Main Menu 33 of 33

Вам также может понравиться