8/9/2019 Chapter 1 - .NET Overview
1/33
.NET Overview
Main Menu 1 of 33
.NET Overview
8/9/2019 Chapter 1 - .NET Overview
2/33
.NET Overview
Main Menu 2 of 33
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.
8/9/2019 Chapter 1 - .NET Overview
3/33
.NET Overview
Main Menu 3 of 33
Scope
Introduction to .NET
.NET Framework
Architecture of .NET Framework
Common Language Runtime (CLR)
Advantages of .NET
Effect of .NET on the End Users
8/9/2019 Chapter 1 - .NET Overview
4/33
.NET Overview
Main Menu 4 of 33
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 Microsofts next generation revolutionary
new platform for Windows and Internet software
development, based on open Internet protocols andstandards.
8/9/2019 Chapter 1 - .NET Overview
5/33
.NET Overview
Main Menu 5 of 33
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 ofplatforms, architecture and solutions.
The developers have broad freedom to write their
applications in whatever programming languagethey are comfortable with.
8/9/2019 Chapter 1 - .NET Overview
6/33
.NET Overview
Main Menu 6 of 33
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.
8/9/2019 Chapter 1 - .NET Overview
7/33
.NET Overview
Main Menu 7 of 33
.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 theywant.
It saves time, enables automatic transactions and
memory management
8/9/2019 Chapter 1 - .NET Overview
8/33
.NET Overview
Main Menu 8 of 33
Architecture of .NET Framework
The major components
of the .NET Framework
can be better explained
with the help of thegiven diagram:
8/9/2019 Chapter 1 - .NET Overview
9/33
.NET Overview
Main Menu 9 of 33
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.
8/9/2019 Chapter 1 - .NET Overview
10/33
.NET Overview
Main Menu 10 of 33
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 providecomponents and services for developing web sites
and web services.
8/9/2019 Chapter 1 - .NET Overview
11/33
.NET Overview
Main Menu 11 of 33
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 variedprogramming languages.
8/9/2019 Chapter 1 - .NET Overview
12/33
.NET Overview
Main Menu 12 of 33
Architecture of .NET Framework
Unified Classes The classes of the .NET
Framework provide aunified, object oriented,
and hierarchical set ofclass libraries.
Some of the servicesprovided by the UnifiedClasses are shown in the
given figure
8/9/2019 Chapter 1 - .NET Overview
13/33
.NET Overview
Main Menu 13 of 33
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.
8/9/2019 Chapter 1 - .NET Overview
14/33
.NET Overview
Main Menu 14 of 33
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 languagesmore equal in capability.
The CLR makes it easy to design components and
applications whose objects interact across languages.
8/9/2019 Chapter 1 - .NET Overview
15/33
.NET Overview
Main Menu 15 of 33
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 programminglanguage as long as the compiler used to compile the
code targets the CLR.
The compiler just checks the syntax and ensures thatwhatever the code is written makes sense; after that
the code is handled by the CLR.
8/9/2019 Chapter 1 - .NET Overview
16/33
.NET Overview
Main Menu 16 of 33
Common Language Runtime
Architecture of CLR
It is very important to
understand the
architecture of the CLR
A diagrammatic
representation is given
here:
8/9/2019 Chapter 1 - .NET Overview
17/33
.NET Overview
Main Menu 17 of 33
Common Language Runtime
Working of CLR
The whole concept of the working of CLR can be brokenup into the following steps:
Processing of a single source code
A single code is compiled by the compiler. Aftercompilation the compiled code is converted into theEXE/DLL file and is ready to be executed.
This is known as the Managed Module.
Actually, this Managed Module is known as theAssembly, which comprises of the IntermediateLanguage (IL).
8/9/2019 Chapter 1 - .NET Overview
18/33
.NET Overview
Main Menu 18 of 33
Common Language Runtime
IL is a CPU independent set of instructions that can beefficiently converted to the native code. It includesinstructions for loading, storing, initializing and callingmethods on objects. Apart from this, it also includesinstructions for arithmetic and logical operations,control flow, direct memory access, exceptionhandling, and such other operations.
O
8/9/2019 Chapter 1 - .NET Overview
19/33
.NET Overview
Main Menu 19 of 33
Common Language Runtime
NET O i
8/9/2019 Chapter 1 - .NET Overview
20/33
.NET Overview
Main Menu 20 of 33
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).
NET O i
8/9/2019 Chapter 1 - .NET Overview
21/33
.NET Overview
Main Menu 21 of 33
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 onbeing executed. The listing of the code is:
using System;
class a{
public static void main() {Console.Writeline(HELLO WORLD);
}
}
NET O i
8/9/2019 Chapter 1 - .NET Overview
22/33
.NET Overview
Main Menu 22 of 33
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 followingscreen:
NET O i
8/9/2019 Chapter 1 - .NET Overview
23/33
.NET Overview
Main Menu 23 of 33
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 certainextent.
The CLR works with the help of Assemblies. This can
be explained with the help of the following example:
NET O i
8/9/2019 Chapter 1 - .NET Overview
24/33
.NET Overview
Main Menu 24 of 33
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 usedto convert all these managed modules to the Assembly.
NET O i
8/9/2019 Chapter 1 - .NET Overview
25/33
.NET Overview
Main Menu 25 of 33
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 processedupon by the CLR.
NET O i
8/9/2019 Chapter 1 - .NET Overview
26/33
.NET Overview
Main Menu 26 of 33
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
NET Overview
8/9/2019 Chapter 1 - .NET Overview
27/33
.NET Overview
Main Menu 27 of 33
Advantages of .NET
Evidence Based Security
Simplified application deployment
Increased Reliability
Improved Performance
Unified Programming model
NET Overview
8/9/2019 Chapter 1 - .NET Overview
28/33
.NET Overview
Main Menu 28 of 33
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.
NET Overview
8/9/2019 Chapter 1 - .NET Overview
29/33
.NET Overview
Main Menu 29 of 33
Effect on the End Users
Built-in Functionality: The .NET Frameworkcontinues the tradition of providing more and morebuilt-in functionality.
Easier Deployment: One of the Basic design goals of
Microsoft .NET Framework is to simplify theinstallation and configuration of the software.
NET Overview
8/9/2019 Chapter 1 - .NET Overview
30/33
.NET Overview
Main Menu 30 of 33
Summary
.NET is based on the Internet protocols andstandards.
The programming language support of .NET allowsaccess 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 WebServices.
The .NET Framework is divided into two majorcomponents; Unified classes and CommonLanguage Runtime.
NET Overview
8/9/2019 Chapter 1 - .NET Overview
31/33
.NET Overview
Main Menu 31 of 33
Summary
CLR provides the execution environment for .NETFramework applications.
IL is a CPU independent machine language.
Metadata is produced by the compiler, whichdescribes the types in the code, and the definition ofeach type.
The CLR contains the JIT compiler which convertsthe IL to the native code.
NET Overview
8/9/2019 Chapter 1 - .NET Overview
32/33
.NET Overview
Main Menu 32 of 33
Self Assessment
Fill up the blanks:
The heart of the .NET Framework is known as the
________________
A major design goal of the .NET is to _______ theconfiguration and installation of the software.
The __________reduces the use of Interface Definition
Language.
The Runtime Environment is provided by the___________ in the .NET Framework.
The _________converts the IL into native code.
CLR
simplify
CLR
JIT
Metadata
NET Overview
8/9/2019 Chapter 1 - .NET Overview
33/33
.NET Overview
Main Menu 33 f 33
Self Assessment
State True or False:
The class libraries of the .NET Framework provide a rich
built in functionality. (T/F)
The runtime fails to provide the services such as memorymanagement. (T/F)
In the .NET Framework, the code has to be compiled
every time it has to be executed. (T/F)
Value types are either built in value types or user definedtypes. (T/F)
The basic idea behind the CLR was to allow the
developers to write less code and use more code. (T/F)
T
F
F
T
T