Professional Documents
Culture Documents
Code and
data
structures
.NET Framework
Unified Classes
ASP.NET
W eb C lasses (AS P.N ET)
Controls, Caching, Security, Session, Configuration e
Unified Classes
D ata (ADO .NET) W indow s Form s
ADO , SQ L,Types etc Design, Cm pnt M odel etc
ASP.NET
Visual Studio.NET
Windows
Web Forms Web Services
Forms
Mobile Internet Toolkit
Operating System
Framework, Languages, And Tools
VB C++ C# JScript J#
ASP.NET
Visual Studio.NET
Windows
Web Forms Web Services
Forms
Mobile Internet Toolkit
Operating System
Common Language
Runtime
The Common Language Runtime is the
execution engine for .NET Framework
applications:
CTS: Common Type System
CLS: Common Language Specification
CIL and Metadata
VES: Virtual Execution System
Common Language Runtime
Base Class Library Support
Class Loader
Common Language Runtime
Manages running code
Verifies type safety
Provides garbage
collection, error
handling
Code access security for
semi-trusted code
Provides common type
system
Value types (integer,
float, user defined, etc)
Objects, Interfaces
Provides access to
system resources
Native API, COM interop,
etc
Compilation And Execution
Compilation
Native JIT
Code Compiler At installation or the
first time each
Execution method is called
All Languages are compiled to IL code
Portable Executable File (PE File)
PE Header
CLR Header
Metadata
MSIL Code
Resources
Metadata:
data about data; description of assembly, description of types, attributes
objects can communicate with each other
Stored in binary format, CLR loads metadata into memory for reference
IL code:
intermediate language, CPU independent sets of instructions
Assembly:
a basic unit of versioning, deployment, security management, execute, reuse
and sharing.
Manifest: Assembly Metadata
Assembly (1)
An assembly is the primary building
block of a .NET Framework application.
It is a collection of functionalities that is
built, versioned, and deployed as a
single implementation unit (as one or
more files).
In general assemblies consist of:
Assembly metadata (manifest)
type metadata
IL code
Resources
Assembly (2)
The Manifest
identity (name, version number, optional
culture)
file list (name + cripto hash for files in
the assembly)
referenced assemblies (references to
other assemblies (which version?))
exported types and resources
permission requests (requested, desired,
never granted)
Type Metadata
signature (description) for types
contained in the assembly
name, visibility, base class, interfaces
implemented
members (methods, fields, properties,
events, nested types)
custom attributes:
user defined, complier defined, framework
defined
used for design, reflection, conversion,
serialization, debugging, profiling
How CLR Acts as a Virtual
Machine?
Class Loading
Type Verification
IL to native JIT conversion
Class Loader
Loads referenced classes from assemblies
into memory
it ensures:
some consistence checking for loaded types
stubs calling JIT compiler for new loaded classes
known amount of required space for classess of
instantiable types, subclasses of abstract types
the shape of the space is known
references made by the loaded type to types that
have already been loaded are resolved.
Type Safety and Verification
Constraints to verify:
A reference to a type is strictly compatible with the
type being referenced (typed thing and reference).
Only appropriate operations can be invoked on an
object.
Identities are what they claim to be (no way to
corrupt or spoof objects).
The loader:
ensures that type signatures are consistent
between the use and implementation of every
method and field (the incoming values have the
indicated type signature).
The verification algorithm:
ensures that the implementation maintains the
correctness of the type signatures.
JIT Compilation
Before MSIL can be executed, it must
be converted to native code
convert the MSIL as it is needed
caching of the resulting native code for
subsequent calls.
Simplify Development
Completely eliminates COM plumbing
No more…
Registration =>self described apps
GUIDs =>hierarchical namespaces
.IDL files =>unified object model
HRESULTs =>structured exceptions
i 123
o System.Int32
123
j 123
Robust Environment
Automatic lifetime management
All objects are garbage collected
Exception handling
Error handling first class and mandatory
Type-safety
No buffer overruns, No unsafe casts,
Uninitialized variables
Secure Environment
Security designed-in
Code access security enforcement
Security based on the identity of code
Administratively configurable via policy
ASP.NET integrated authentication
of user
Windows identity, Passport , forms-based, …
®
ASP.NET
Visual Studio.NET
Windows
Web Forms Web Services
Forms
Mobile Internet Toolkit
Operating System
Unify Programming Models
Consistent API availability regardless of
language and programming model
.NET Framework
RAD, Subclassing, Stateless,
Composition, Power, Code embedded
Delegation Expressiveness in HTML pages
Windows API
How Much Simpler?
Windows API
HWND hwndMain = CreateWindowEx(
0, "MainWClass", "Main Window",
WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
(HWND)NULL, (HMENU)NULL, hInstance, NULL);
ShowWindow(hwndMain, SW_SHOWDEFAULT);
UpdateWindow(hwndMain);
.NET Framework
Dim form As New Form()
form.Text = "Main Window"
form.Show()
Factored And Extensible
The Framework is not a “black box”
Any .NET class is available for you to
extend through inheritance
Gives developers much more head room
Plug and Play components
and subsystems
The .NET Framework Library
ASP.NET
Web Forms Web Services Windows
Mobile Internet Toolkit
Forms
System.Data System.Xml
OleDb SqlClient XSLT Serialization
Common SQLTypes XPath
System
Collections IO Security Runtime
Configuration Net ServiceProcess InteropServices
Diagnostics Reflection Text Remoting
Globalization Resources Threading Serialization
Base Framework
System
Collections Security
Configuration ServiceProcess
Diagnostics Text
Globalization Threading
IO Runtime
Net InteropServices
Reflection Remoting
Resources Serialization
Data And XML
System.Data
OleDb SQLClient
Common SQLTypes
System.Xml
XSLT Serialization
XPath
ASP.NET
System.Web
Services UI
Description HtmlControls
Discovery WebControls
Protocols
Caching Security
Configuration SessionState
Windows Forms®
System.Windows.Forms
Design ComponentModel
System.Drawing
Drawing2D Printing
Imaging Text
Framework, Languages, And Tools
VB C++ C# JScript J#
ASP.NET
Visual Studio.NET
Windows
Web Forms Web Services
Forms
Mobile Internet Toolkit
Operating System
Family of Languages
Languages
The .NET Platform is language neutral
All .NET languages are first class players
You can leverage your existing skills
Common language specification
Set of features guaranteed to be in all languages
MS providing
Visual Basic.NET®, C++.NET, C#, J#, JScript®
Third-parties are building
APL, COBOL, Delphi, Pascal, Eiffel, Haskell, ML,
Oberon, Perl, Python, Scheme, Smalltalk…
Standardization
A subset of the .NET Framework and C#
submitted to ECMA
Adopted as International standards in
Dec. 2001 in the ISO fast-track process.
Now Co-sponsored with Intel, Hewlett-
Packard
Common language infrastructure
Based on common language runtime and
base framework
Layered into increasing levels
of functionality
.NET Languages (Microsoft)
Microsoft: Visual Basic.NET
Microsoft: C#
Microsoft: C++ (Managed/Unmanaged)
Microsoft: J#
.NET Languages (Others)
APL Oberon
Fujitsu COBOL Pascal
Micro Focus COBOL Perl
Eiffel Python
Forth RPG
FORTRAN 95 S#
Haskell Scheme
Mercury Standard Meta
Mondrian Language
Is .NET right for you?
Ability to Execute
providing more vision and influence
regarding this shift than any other
vendor.”
IBM
Sun
Gartner Group HP
“.NET is a leading example of what Oracle
we believe will be the dominant
architectural model for the third
generation of Internet applications.” Completeness of Vision
*Source: Gartner Research, 9/13/2001
Middleware App. Server & Web
Services Benchmark
6000
4000
J2EE by 339% on the Web
application benchmark
3000
2000
1000
0
J2EE Application J2EE Application .NET 1.0/W2K .NET 1.1/Windows.NET
Server A Server B
Web Services Benchmark
Web Service Hosting Performance
Multiple
1000
Clients Making Remote SOAP Requests over HTTP
2CPU
900 4CPU 550 MHz Compaq
800 8CPU
700
SOAP Requests/sec
600
.NET Framework 1.1 on Windows Server 2003
500 outperforms J2EE by 331% in Web service testing
400
300
200
100
0
J2EE A J2EE B MS W2K MS Win .NET
Developer Productivity:
Comparing .NET And J2EE Implementations
Based on new Middleware J2EE Reference Application with EJBs
and Equivalent .NET Reference Application with C# Components
.NET Implementation
16000
14004
J2EE Implementation
14000
12000
Lines of Code Required
10000
Optimizing, configuring
8000
J2EE: 10 man-weeks per application server
6187
.NET:
5567 2 man-weeks
6000
4000 2096
2053
1002 795
2000
197 197 102
0
Total User Interface Middle Tier Data Tier Config
Summary
The .NET Framework
Dramatically simplifies development and
deployment
Unifies programming models
Provides robust and secure execution
environment
Supports multiple programming
languages
Discussion