Microsoft .NET
Introduction into the next generation
of Internet Applications
Tuna Oezer
Ex-Program Manager
Runtime Kernel
Outline
Evolution
.NET Overview
.NET Architecture
Common Language Runtime
C#
Evolution of the Internet
1st Generation: 1994 – 1996
Infrastructure
Static Pages
E-mail
Browsers, Web Servers
2nd Generation: 1996 – 2000
Dynamic Pages
Personalization, e-commerce
Applets, Databases
The Future of the Internet
3rd Generation
Beyond Browsing
Integration of Internet
Web Services
XML Service 3
XML
Server XML
XML Service 2
HTML /XML
XML
Client Service 1
Evolution of the PC
Past: Desktop is only device
Future: Many Devices, Mobility
Desktop
Notebook
PDA
Tablet PC
TV, Toaster, etc.
Evolution of Hardware
Moor's Law
Computing power increases
exponentially
Computing cost decreases
Networking
Broadband network access
Static connections
Wireless
Evolution of Software
From Standalone to Networking
Necessity to interoperate with many
devices
Distributed Software
From Product to Service
Open Source
Subscription to software
Services around software
Microsoft .NET
Move towards a service oriented
business model
Provides a platform and tools for
service providers
Integrate and connect many different
kinds of devices over Internet
Scenario
Example: Health Care
Scenario
Example: Health Care
Smart devices
Mobility, geographic services
Medical information is stored online
Appointments can be scheduled
online (Web Service)
Authentication, Security
Broadband, wireless networks
Interactive user interface
Microsoft’s Vision
People will use many different kinds
of devices
Information will be accessible from
anywhere
Information will stay in digital form
Companies will offer services via the
web
Guest Speaker
Bill Gates, Chief Software Architect
Guest Speaker
Bill Gates, Chief Software Architect
Platform for Internet and a Variety of
Devices
Smart devices
Digital World
Data, XML, Services
Need easier development of Internet
applications
More powerful hardware and networks
Microsoft’s Mission
Empower people through great
software any time, any place, and on
any device
Provide a platform for the Internet
.NET Framework
Provide tools for developers
Visual Studio .NET
Provide data storage and access
.NET Enterprise Servers
Provide services over the Web
Passport, Hotmail, Directory, …
Vision of Software Industry
.NET vision is shared by many
companies
Microsoft offers complete solution
Important differences between
visions:
“Smart devices” vs. “dumb terminals”
“Write once run everywhere” vs. adapt to
device and interoperate with others
(“Orchestration”)
Different Approaches
.NET Framework
Desktop, Servers
.NET
Functionality, Power, Features
.NET Compact Framework
Smart Devices (PocketPC, Set
Java
Top Box, etc)
.NET Compact Framework and Other
Pager, Cell Phone, etc.
Reach across device form factors, CPUs, OSes
Open Standards
.NET is based on open Internet
standards
.NET itself is an open standard
ECMA standardization is currently in
progress
Microsoft .NET Includes
.NET Framework
Visual Studio .NET
ASP .NET
Windows .NET
.NET Enterprise Servers
Building Block Services
.NET Architecture
Your Application
and Web Service
Orchestration
Other
Operations
Applications Building Block
Using Your .NET
Framework Services
Service
Windows
CE, 2000, XP, .NET
End-User Public Web Services
Clients Open Internet Protocols
SOAP, SCL, DISCO
HTTP, SMTP, XML, WAP, XSD
.NET Framework
Web User
Services Interface
Data & XML
Base Classes
Common Language Runtime
Orchestration
.NET Building
.NET
Enterprise Block
Framework
Servers Services
Windows (CE, ME, 2000, and .NET)
Base Classes
System
Collections Security
Configuration ServiceProcess
Diagnostics Text
Globalization Threading
IO Runtime
Net InteropServices
Reflection Remoting
Resources Serialization
Web Services
Concept Web Protocol Framework
Data XML Objects
Schema XSD (XML Classes
Schema Definition)
Services SCL (SOAP Methods
Configuration
Language)
Invocation SOAP Calls
XML Built in
XML Parser is built into .NET
Framework
XML custom parser automatically
generated from XSD document and
compiled into native code
SOAP is built into .NET
Common Language Runtime
Platform for .NET applications
Provides runtime support
Provides security features
Enables interoperation of applications
XML, SOAP, etc.
Other Application Your Application Other Application
(CLR) (CLR) (Other platform)
CLR
Services of the CLR
Class Loading and Layout
Garbage collection (dynamic)
20-40 clock cycles for deallocation,
scalable and multi-processor
Code Manager (manages execution)
Exception Manager (based on SEH)
Type Checker
Security Engine
Thread Support
Debug Engine
COM Marshaler
One Runtime For All
Languages
CLR is an open standard
Any language can make use of CLR
services
Any language can use classes written
in any other language (consumer)
Any language can (code) inherit
classes written in any other language
(extender)
A language can become a provider
Types of Supported
Languages
Object Oriented
Procedural
Functional
Common Language Specification
Same Tool can be used for all
languages
Metadata: Creation And Use
Source Reflection
Serialization Code
(e.g. SOAP)
Designers
Compiler
Other
Compiler Debugger
Type Browser Metadata Profiler
(and code)
Schema Proxy Generator
Generator
XML encoding
(SDL or SUDS)
Current List of Languages
Ada Java .NET (Rational)
APL ML
Basic (Visual Basic) (MS Research Cambridge)
C# Mercury
(Melbourne U.)
C
Oberon
C++ (Zurich University)
COBOL Oz
Component Pascal (Univ of Saarlandes)
(Queensland Univ of Tech) Perl
ECMAScript (JScript)
Python
Eiffel
(Monash University) Scheme
Haskell (Northwestern U.)
(Utrecht University) SmallTalk
Built-in Support For
Classes
Global Procedures, Static, Instance
and Virtual Methods
Subroutines and Co-routines
Constructors
Inheritance (Type and Code)
Overriding and Overloading
Access Control and Hiding
Attributes
All Object Oriented
All data types are objects, including
Integers, Chars, etc.
Single Object class for all languages
Value Types
Represent “primitive” types in an
efficient way
Extensible
Boxing and unboxing
Intermediate Language (IL)
Assembly Language of CLR
Code is never interpreted
VC Standard JIT
Compiler
VB
Native
IL
Code
...
“Econo”-JIT
Compiler
Script
Verification
IL is verified by a verifier and
guaranteed to be type safe
Checks for type casts, memory
initialization, array bounds
Checks stack operations
Security System
Permissions
Grant
Demand (minimal, optional, refuse)
Stack walk
Policy – Set of permissions
Evidence – Input to policy
Zones
Cryptography
Signed XML – IETF/W3C XMLDSIG
Fully extensible
Managed vs. Unmanaged
Managed Code makes use of CLR
services
Unmanaged Code does not use any
services
Garbage Collector can be turned off
CLR offers mechanisms for managed
code to interact with unmanaged code
Interoperation with hardware specific
code and other platforms
Ability to reuse old code
Versioning
Multiple versions of component can
be installed on machine
A single process can use different
version of component at same time
Zero-impact installation and
uninstallation (copy)
Runtime Control Flow
Class
Loader
First
reference to
IL to native type
code compiler
Execution
Support
First call to
Managed method
Code Native
Managers Code
Security
CPU
System
Common Language Runtime
Other Classes
Base Classes
Common Language Runtime
Execution
native code
compilers
Security
Support
IL to
GC, stack walker, code manager
Class loader and layout
C#
Built on top of CLR
Was designed from ground up to
make use of CLR services
Component Oriented
Properties are first class
Events are first class
Hello World
using System;
class Hello {
static void Main() {
Console.WriteLine(“Hello word”);
}
}
Structure
Namespaces
May be nested
Types
Members
C# Type System
All types extend Object
There are no primitive types
Implicit boxing and unboxing
C# Types Definitions
Classes
Interfaces
Contain methods, properties, indexers,
events
Private implementations
Structs (stack allocated)
Enums
Delegates
Object-oriented function pointers
Multi-cast
C# Member Definitions
Constants
Fields
Methods (static, instance, virtual)
Constructors and Destructors
Properties
Indexers
can be overloaded
Events
Operators
Properties
class Person {
private string _name;
public string name {
get {
return _name;
}
set {
_name = value;
Console.WriteLine(_name);
}
}
}
Attributes
Types and members may have
attributes associated with them
Attributes are themselves defined by
classes, extend System.Attribute
Extensible
Type-safe
Used for XML, SOAP, etc.
Other Features
Parameter arrays
Versioning
new and override
XML comments
Unsafe Code
Interop
Enables pointer arithmetic
Pinning
Conditional Compilation
#define, #if, etc.
Conditional methods
Attribute Conditional(“Debug”)
E.g., Assert