Sunteți pe pagina 1din 16

Introduction au .

NET FrameWork

Stphane RZETELNY - Ingnieur 2000 - Informatique Rseaux


Octobre 2002

PLAN

Quest-ce que le .NET FrameWork ?


Les objectifs du .Net FrameWork
Notion dassemble
Comment a fonctionne
Interoprabilit
Standardisation du .Net FrameWork
.Net FrameWork et Linux

Quest-ce que le .NET FrameWork ?


Un nouvel environnement de
dveloppement et dexcution
Lintroduction dun nouveau langage : C#
Une bibliothque de classes extensibles,
regroupes par namespace en C#

Objectifs du .NET Framework


Environnement dexcution robuste et scuris
Common Language Runtime (CLR)
Code manag : Garbage Collector, Type Safe..
Runtime Security

Dploiement et administration simplifis


Xcopy, Versioning

Intgration de lexistant
Multiples langages de programmation
Interoprabilit COM et Win32
Compatibilit side by side

Dveloppement dapplications simplifi


Modle de programmation unifi
Elever le niveau dabstraction
classe, interface, hritage, proprit, constructor, exception
Elimination complte de la plomberie COM
Bibliothque de classe riche et extensible
Intgration native des standards Web (HTTP,XML, SOAP, ...)

CLR : Vue densemble


Base Class Library Support
Thread Support

COM Marshaler

Type Checker

Exception Manager

Security Engine

Debug Engine

IL to Native
Compilers

Code
Manager
Class Loader

Garbage
Collector

Assembly : Dfinition

Unit de dploiement
Point dentre dexcution
Unit de contrle de scurit
Unit de contrle de version
Unit de rutilisation
Unit de visibilit des types
Unit dexcution cote cote

Assembly : 2 formes dutilisation


On considre 2 types dassembly :
Prive : Ddie lutilisation dun programme
particulier. Se situe gnralement dans
larborescence du programme qui lutilise.
Partage : Utilise par un ensemble de
programme diffrents. Se situe gnralement
dans le GAC (Global Assemblies Cache)

Assembly : contenu

Un manifest : metadonnes de lassembly


Les mtadonnes dcrivant les types utiliss
Le code IL
Les ressources utilises (images,)
La liste des fichiers qui la compose

Global Assemblies Cache (GAC)


Un cache accueillant les assembles partages
par plusieurs applications
Doivent tre dfinies avec des noms forts
Grce au mcanisme de cl prive, cl publique
Pour garantir lunicit dune version dune assemble
Pour garantir lintgrit de lassemble

Doivent faire rfrence des assembles


fortement nommes !

Comment a marche : 1. Le Dveloppement


DEVELOPMENT
publi c st at ic void Main( Str i ng[ ] ar gs )
{ Str ing usr ; Fi leSt ream f ; St r eamWr it er w;
tr y {
usr =Envir onment .GetEnvi r onment Var iable("USERNAME") ;
f=new FileSt r eam( C:\\ test .t xt ", Fil eM ode.Cr eate);
w=new Str eamWr
publi citst
er(
at
f );
ic void Main( Str i ng[ ] ar gs )
w.Wr i teLi ne(usr)
{ Str ;ing usr ; Fi leSt ream f ; St r eamWr it er w;
w.Close( );
tr y {
} cat ch ( Except ion
usr e){
=Envir onment .GetEnvi r onment Var iable("USERNAME") ;
Console.Wri teLi
f=new
ne( "Except
FileStion:
r eam(
"+e.ToSt
C:\\ test
r ing(
.t xt
))",
; Fil eM ode.Cr eate);
w=new Str eamWr it er( f );
}
w.Wr i teLi ne(usr) ;
}
w.Close( );
} cat ch ( Except ion e){
Console.Wri teLi ne( "Except ion: "+e.ToSt r ing( )) ;
}
}

Source code

Compiler

Assembly

C#
J#
VB
Cobol

MSIL
Metadata
Resources

Comment a marche : 2.Le Dploiement


DEVELOPMENT
publi c st at ic void Main( Str i ng[ ] ar gs )
{ Str ing usr ; Fi leSt ream f ; St r eamWr it er w;
tr y {
usr =Envir onment .GetEnvi r onment Var iable("USERNAME") ;
f=new FileSt r eam( C:\\ test .t xt ", Fil eM ode.Cr eate);
w=new Str eamWr
publi citst
er(
at
f );
ic void Main( Str i ng[ ] ar gs )
w.Wr i teLi ne(usr)
{ Str ;ing usr ; Fi leSt ream f ; St r eamWr it er w;
w.Close( );
tr y {
} cat ch ( Except ion
usr e){
=Envir onment .GetEnvi r onment Var iable("USERNAME") ;
Console.Wri teLi
f=new
ne( "Except
FileStion:
r eam(
"+e.ToSt
C:\\ test
r ing(
.t xt
))",
; Fil eM ode.Cr eate);
w=new Str eamWr it er( f );
}
w.Wr i teLi ne(usr) ;
}
w.Close( );
} cat ch ( Except ion e){
Console.Wri teLi ne( "Except ion: "+e.ToSt r ing( )) ;
}
}

Assembly

Source code

DEPLOYMENT

Compiler

Install Assembly

C#
J#
VB
Cobol

MSIL
Setup
Copy Metadata
BrowserResources

Global
Assembly
Cache (GAC)
Application
Directory

Download
Cache

Comment a marche : 3. Lexcution


DEPLOYMENT

DEVELOPMENT
Install

Assembly

Setup
Copy
Browser

EXECUTION
IL to Native
Compiler

Native .exe
+ GC table

Class
Loader

Code
Manager

Security

Assembly
Global
on Target Policy
Assembly
Machine
Cache
(GAC)

<?xml ver sion="1.0" encoding=" ut f- 8" ?>


<conf igur at i on>
<mscor li b>
<secur it y>
<poli cy>
<Poli cyLevel ver si on="1">
<CodeGr oup cl ass="Uni onCodeGr oup"
ver sion="1"
Per mi ssi onSet Name="Not hing"
Name="All_Code"
Descr ipt i on="Code gr oup
gr ant s no per missio
ns and f or ms t he r oot of t he code gr oup t r ee.">
<I Member shipCondit ion cl as
s="Al lMember shi pCondi t ion"
ver si on="1"/>
<CodeGr oup cl ass="Uni onCodeGr oup"
version="1"
Per missi onSetN ame="Ful lTr ust "

Application
Directory
Assembly
Loader
Download
Cache
Garbage Collection
Exception Manager
Thread Support

Debug Engine

COM Interop

Interoprabilit
Interoprabilit des langages, grce au
langage intermdiaire (IL)
Interoprabilit avec COM
Interoprabilit avec Win32

Standardisation
C# et CLI qui sont dposs l'ECMA
CLI (Common Language Infrastructure) est trs prcis quand a
ce que l'on doit trouver dans le "framework " et le "runtime " et
laisse champ libre sur la manire de l'implmenter
ECMA-334, C# (C sharp) Language Specification.
ECMA-335, Common Language Infrastructure, approved by the
ECMA General Assembly of 13th December 2001.
ECMA TR/84, related to Standard ECMA-335

.Net FrameWork et Linux !


Dbut du portage du framework .Net
Diffrents projets :
Mono par le crateur de gnome
GNU Portable DotNet
Rotor (FreeBSD)

Sites Internet

http://www.gotdotnet.com
http://www.dotnetguru.org
http://www.dotnet-fr.org/
http://msdn.microsoft.com/netframework/

http://www.go-mono.com/
http://www.southern-storm.com.au/

S-ar putea să vă placă și