Title: TechEd Europe Keynote
1Introduction to .NET
Manuel Costa Academic Computer Science Program
Manager manuelc_at_microsoft.com
2What is .NET?
- A development platform interfaces, components
and tools to develop software - The biggest change in the Microsoft platform
since Windows NT replaced DOS - Changes include
- Code formats, compilers,
- Code loading and execution models,
- Security model,
- Object model, metadata, remoting protocols
- Class libraries,
3.NET Principles The Microsoft Vision for
Computing
- Make Internet-scale distributed computing
ubiquitous - Exploit inexpensive cycles and bandwidth
- Seamless integration of multiple applications and
devices - Deliver software as a service
- Next generation user experience
The .NET Framework is the programming-model
substrate for the .NET vision
4.NET Framework
- Common Language Runtime (CLR)
- Multi-language support
- Common type system
- Simplified deployment
- Code Access Security
- Rich Class libraries
- Powerful, Consistent Programming Model
- Focus on code, not plumbing
- Built for Tools
- Support for design-time functionality
- Debugging, profiling, instrumentation support
ADO.NET and XML
Base Class Library
Common Language Runtime
5Common Language Runtime
DEVELOPMENT
public static void Main(String args ) String
usr FileStream f StreamWriter w try
usrEnvironment.GetEnvironmentVariable("USERNAME")
fnew FileStream(C\\test.txt",FileMode.Cre
ate) wnew StreamWriter(f)
w.WriteLine(usr) w.Close() catch
(Exception e) Console.WriteLine("Exception"
e.ToString())
public static void Main(String args ) String
usr FileStream f StreamWriter w try
usrEnvironment.GetEnvironmentVariable("USERNAME")
fnew FileStream(C\\test.txt",FileMode.Cre
ate) wnew StreamWriter(f)
w.WriteLine(usr) w.Close() catch
(Exception e) Console.WriteLine("Exception"
e.ToString())
C J VB Cobol
Source code
CIL Metadata Resources
6Common Language Runtime
DEPLOYMENT
Setup Copy Browser
7Common Language Runtime
DEPLOYMENT
Policy lt?xml version"1.0" encoding"utf-8"
?gt ltconfigurationgt ltmscorlibgt
ltsecuritygt ltpolicygt
ltPolicyLevel version"1"gt
ltCodeGroup class"UnionCodeGroup"
version"1"
PermissionSetName"Nothing"
Name"All_Code"
Description"Code group grants no permissions
and forms the root of the code group tree."gt
ltIMembershipCondition
class"AllMembershipCondition"
version"1"/gt
ltCodeGroup class"UnionCodeGroup"
version"1"
PermissionSetName"FullTrust"
EXECUTION
8.NET Framework Namespace
System.Web
System.WinForms
Services
UI
Design
ComponentModel
Description
HtmlControls
Discovery
WebControls
Protocols
System.Drawing
Caching
Security
Drawing2D
Printing
Text
Configuration
SessionState
Imaging
System.Data
System.Xml
ADO
SQL
XSLT
Serialization
Design
SQLTypes
XPath
System
Collections
IO
Security
Runtime
InteropServices
Configuration
Net
ServiceProcess
Remoting
Diagnostics
Reflection
Text
Serialization
Globalization
Resources
Threading
9.NET Framework Design Goals
- Simplify application development
- Provide a robust and secure execution environment
- Support multiple programming languages
- Simplify deployment and management
10Simplify Development
Windows API
HWND hwndMain CreateWindowEx( 0,
"MainWinClass", "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
Form form new Form() form.Text "Main
Window" form.Show()
11Simplify Development
- Organization
- Code organized in hierarchical namespaces and
classes - Unified type system
- Everything is an object, no variants, one string
type, all character data is Unicode - Component Oriented
- Properties, methods, events, and attributes are
first class constructs - Design-time functionality
12Robust And Secure
- Automatic lifetime management
- All .NET objects are garbage collected
- No stray pointers, no circular references
- Code correctness and type-safety
- IL can be verified to guarantee type-safety
- No unsafe casts, no uninitialized variables,
no out-of-bounds array indexing - Evidence-based security
- Based on origin of code as well as user
- Extensible permissions
13Multi-Language Platform
- The freedom to choose language
- All features of .NET platform available to any
.NET programming language - Application components can be written in multiple
languages - Debuggers, profilers, code coverage analyzers,
etc. work for all languages - Available Compilers
- From Microsoft VB, C, C, JScript, Java
- From other companies/universities APL, COBOL,
Eiffel, Fortran, Haskell, ML, Perl, Python, RPG,
Scheme, Smalltalk,
14Unify Programming Models
15Broad Language Support
VB.NET
Dim s as String s "authors" Dim cmd As New
SqlCommand("select from " s,
sqlconn) cmd.ExecuteReader()
C
string s "authors" SqlCommand cmd new
SqlCommand("select from "s, sqlconn) cmd.Execu
teReader()
C
String s S"authors" SqlCommand cmd new
SqlCommand(StringConcat(S"select from ", s),
sqlconn) cmd.ExecuteReader()
16Broad Language Support
J
String s "authors" SqlCommand cmd new
SqlCommand("select from "s, sqlconn) cmd.Execu
teReader()
17Broad Language Support
var s "authors" var cmd new
SqlCommand("select from " s,
sqlconn) cmd.ExecuteReader()
JScript
Perl
String s S"authors" SqlCommand cmd new
SqlCommand(StringConcat(S"select from ", s),
sqlconn) cmd.ExecuteReader()
Python
s "authors" cmd SqlCommand("select from "
s, sqlconn) cmd.ExecuteReader()
18Broad Language Support
19Broad Language Support
RPG
  DclFld MyInstObj Type( System.Data.SqlClient.Sq
lCommand ) Â DclFld s Type( string ) Â s
"authors" Â MyInstObj New System.Data.SqlClient.S
qlCommand("select from "s,
sqlconn) Â MyInstObj.ExecuteReader()
Fortran
assembly_external(name"System.Data.SqlClient.Sq
lCommand") sqlcmdcharacter10 xsqlcmd Cmd
x'authors' cmd sqlcmd("select from "//x,
sqlconn)Â Â Â Â Â Â Â Â Â Â call cmd.ExecuteReader() endÂ
20Broad Language Support
s?String.New authors cmd?SqlCommand.New
(select from ,s.ToString s)
sqlconn cmd.ExecuteReader
   s 'authors'.    cmd
SqlCommand('select from 's, sqlconn). Â Â Â
cmd.ExecuteReader().
Smalltalk
21Broad Language Support
Scheme
(let ( (s "authors") Â Â (cmd (new-SqlCommand
(string-append "select from " s)
sqlconn))) (execute-command cmd))
local      s STRING      cmd SQLCOMMAND do
    s "authors"     create cmd("select
from " s, sqlconn) Â Â Â Â Â cmd.ExecuteReader() end
Eiffel
ExecuteReader invoke System.Data.SqlClient.Execu
teReader() SqlCommand create
System.Data.SqlClient.SqlCommand(String,\
System.Data.SqlClient.SqlConnection) qu
ery sqlconn -gt let s "authors" in  Â
cmd lt- SqlCommand ("select from "s, sqlconn)
 cmd ExecuteReader()   Â
Mondrian
22Simplify Deployment And Management
- Assemblies
- The unit of deployment, versioning, and security
- Like DLLs, but self-describing through manifest
- Zero-impact install
- Applications and components can be shared or
private - Side-by-side execution
- Multiple versions of the same component can
co-exist, even in the same process
23XML Web Services Anytime, Anywhere, on any
Device
SOAP
Web App
SOAP
HTTP HTML
SOAP
Gateway
Custom/ WAP
24.NET Compact Framework
- .NET Framework for Embedded Devices
25Standardizing .NET
- CLI and C standardized by ECMA
- Submission with Intel and Hewlett-Packard
- On December 13, 2001, the ECMA General Assembly
ratified the C and common language
infrastructure (CLI) specifications into
international standards. - Some companies are implementing the ECMA specs,
e.g. Ximian and Project Mono (.NET on Linux) - Microsoft will provide a shared-source
implementation on FreeBSD and Windows - http//msdn.microsoft.com/net/ecma/
26How to try the .NET platform?
- .NET Framework SDK (essential)
- CLR, command line compilers, debuggers, class
libraries, documentation, - Free Download
- Size 100 MB
- Tool Developers Guide
- Specs IL, Metadata, Debugging, Security, etc
- Source code CLisp, Simple C, debugger, profiler,
- Visual Studio .NET (optional)
- IDE (Integrated Development Environment)
- Size 1.5 GB
27.NET in Summary
- The Microsoft software development platform for
the next decade - Based on standards, across languages, across
devices - Based on the idea of ubiquitous XML Web Services
28More Information
- http//msdn.microsoft.com/net