.NET and .NET Framework

download .NET and .NET Framework

of 32

Transcript of .NET and .NET Framework

  • 8/6/2019 .NET and .NET Framework

    1/32

    .NETFran n

    ework

    ro uc on

    MahrG.Mohyuddin

  • 8/6/2019 .NET and .NET Framework

    2/32

    .NETand.NETFr

    Whatis.NET?

    Whatis.NETFramewor

    Whatare.NETTechnol

    ApplicationPlatformson

    .NETvs.JAVA

    mework

    ?

    gies?

    .NET

  • 8/6/2019 .NET and .NET Framework

    3/32

    Whatis.NET?

    AsetofMicrosoftsoftwarete information,people,systems,

    Providesanabstractionte a s.

    Enableshighlevelapplicatio

    Adevelopmentplatform:inte developsoftware.

    AThebiggestchangeinthe

    WindowsNTreplacedDOS.

    hnologiesforconnecting anddevices.

    hnologyforalltypesof

    integration.

    faces,componentsandtoolsto

    icrosoftplatformsince

  • 8/6/2019 .NET and .NET Framework

    4/32

    Whatis.NETFra

    Providesthefoundation .NETbasedapplication

    Consistsoftwocompon

    ommon anguagerunt .NETFrameworkclassl

    ework

    forbuildingandrunning

    nts

    me brary

  • 8/6/2019 .NET and .NET Framework

    5/32

    CommonLangua (CLR)

    Avirtualmachinecom framework.

    Microsoft'simplement

    LanguageInfrastructu Managesexecutionof

    Supports alllanguages

    eRuntime

    onentof.NET

    tionoftheCommon

    e(CLI) thecode.

    hichareCLScompliant

  • 8/6/2019 .NET and .NET Framework

    6/32

    .NETFramework

    FCL exposesfeatureso

    Provideslibraryofclass windows-basedandXM

    .NETFrameworkclassli ADO.NET(ActiveXDat

    ASP.NET(ActiveServe

    XMLWebServices

    UserInterfaces

    lassLibrary

    theruntime.

    saccessedbyallWeb, Webserviceapplications

    braryincludes: Objects)

    Pages)

  • 8/6/2019 .NET and .NET Framework

    7/32

    Framework,Languag s,AndTools

  • 8/6/2019 .NET and .NET Framework

    8/32

    PrincipalDesignFe

    Interoperability

    CommonRuntimeEn

    Lan ua eInde enden

    BaseClassLibrary

    SimplifiedDeployment

    Security

    Portability

    tures

    ine

    ce

  • 8/6/2019 .NET and .NET Framework

    9/32

    HowThe.NetFra

    VisualBasicApplications

    .NETFr

    Data

    ADO.

    Applications

    VisualC++Applications Common

    Runt

    WebS

    Wind

    SourcecodecompilesasMSIL

    eworkWorks

    mework

    ypes

    NET

    anguageime

    rvices

    ows

    .NETPlatformCode

    JITcompilerproducesmachinelanguage

  • 8/6/2019 .NET and .NET Framework

    10/32

    CompilingandEx ManagedCode

    SourceCode

    LanguageCompiler

    Compilatio

    J

    Co

    Native

    Code

    Execution

    cuting

    MicrosoftIntermediate

    Language(MSIL)

    IT

    piler

    Thefirsttimeeachmethodiscalled

  • 8/6/2019 .NET and .NET Framework

    11/32

    .NETTechnologie

    The.NETFramework WithsupportforXML

    VisualStudio.NET

    SupportingVisualBasic .NETMyServices

    The.NETEnterprise

    BizTalkServer2000 SQLServer2000

    CommerceServer2000

    ebservices

    .NET,C#,C++,and JScript

    ervers

  • 8/6/2019 .NET and .NET Framework

    12/32

    ApplicationPlatfo

    BrowserApps

    WebServiceApps

    Standar

    GUIServices

    TransactionServices

    Sc

    Operatin

    RuntimeE

    rmsToday

    OtherApps

    LocalApps

    Library

    ebripting

    DataAccess

    More

    System

    vironment

  • 8/6/2019 .NET and .NET Framework

    13/32

    The.NETFramew

    BrowserApps

    WebServiceApps

    .NETFramewo

    WindowsForms

    EnterpriseServices

    AS

    Win

    CommonLan

    rk

    OtherApps

    LocalApps

    kClassLibrary

    .NET ADO.NET More

    ows

    uageRuntime

  • 8/6/2019 .NET and .NET Framework

    14/32

    TheCompetition: Environment

    BrowserApps

    WebServiceApps

    StandardJa

    Swing EnterpriseJavaBeans

    Jav

    Windows,Sola

    JavaVirtual

    heJava

    OtherApps

    LocalApps

    vaPackages

    aServerages

    JDBC More

    is,Linux,others

    achine(VM)

  • 8/6/2019 .NET and .NET Framework

    15/32

    DataTypesinthe

    TheCLRdefinesthe (CTS)

    Alllanguagesbuiltonth

    Typesaredividedinto Valuetypes:

    Referencetypes:

    CLR

    ommonTypeSystem

    CLRusetheCTS

    twocategories

  • 8/6/2019 .NET and .NET Framework

    16/32

    Illustratingth

    Object

    B te

    Class

    Interface

    Bo

    Char

    De

    String

    Array

    Delegate

    ReferenceTypes

    Others

    CTS

    ValueType

    Int16 Sin leUInt16

    lean

    imal

    DoublInt32

    Int64

    UInt32

    UInt64

    ValueTypes

    Enum

    Structure

    Others

    NET d J R i

  • 8/6/2019 .NET and .NET Framework

    17/32

    .NETandJava :R Environments

    .NETFramework Intermediatelanguageis

    Providesjust-in-time(JIT

    ere sno n erpre er n Java

    Intermediatelanguageis

    Originaldesignhadtarg

    JavaVMswithJITcompil

    ntime

    MSIL

    compilation

    e

    bytecode

    tedinterpretationofbytecode

    ationarenowalsoused

    C il ti i th NET

  • 8/6/2019 .NET and .NET Framework

    18/32

    Compilationinth Environment

    ClassX

    ClassY

    ClassZ

    SourceCode

    M

    MSIL

    forCl

    .NET

    Com iler C#

    tadataforClassesX,YandZ

    DLLorEXE

    ode

    ssX

    MSILCode

    forClassY

    MSILCode

    forClassZ

    VB.NET,etc.)

    Th St t f

    NET

  • 8/6/2019 .NET and .NET Framework

    19/32

    TheStructureofa FrameworkAppli

    Class

    Method

    ClassX

    Method 1

    AppDoma

    Assem

    JITCom

    Method

    MethodMethod

    Method3Method 2

    Loader

    CommonLangu

    MetadataforClass

    .NET ation

    ClassZ

    1 Method1

    n

    bly

    iler

    4

    32 Method 2

    geRuntime

    GarbageCollector

    sX,YandZ

  • 8/6/2019 .NET and .NET Framework

    20/32

    Languagesin.NE

    All.NETlanguagesar

    Allhavemuchincomm

    VisualStudio.NETsup

    C# VisualBasic.NET

    C++

    JScript

    Otherlanguageswilla

    builtontheCLR

    n

    ports:

    lsobeavailable

  • 8/6/2019 .NET and .NET Framework

    21/32

    AnInterfaceand

    publicinterfaceICalc{intadd(intx,inty);

    intsubtract(intx,i

    }

    publicclassCalculator:

    intadd(intx,inty)

    returnx+y;

    }

    intsubtract(intx,i

    returnx y;

    }

    lassinC#

    ty);

    ICalc{

    {

    ty){

  • 8/6/2019 .NET and .NET Framework

    22/32

    A Simple Comparison :

  • 8/6/2019 .NET and .NET Framework

    23/32

    ASimpleCompariSimilarities

    Similarities: C-derivedsyntax

    Object-oriented

    Singleimplementationi Multipleinterfaceinherit

    Built-inimmutableStrin

    son :

    heritance nce

    type

    A Simple Comparison :

  • 8/6/2019 .NET and .NET Framework

    24/32

    ASimpleCompariDifferences

    C#adds: Attributes

    Properties

    Directmemoryaccess Inunsafecode

    son :

  • 8/6/2019 .NET and .NET Framework

    25/32

    C#

    Anewlanguagedesig .NETFramework (Tha

    SyntaxbasedonC/C++

    BuiltontheCLR,with SupportfortheCTS:

    Classes

    Inheritance

    Methodoverloading

    edexpresslyfortheiswhatMicrosoftsays)

  • 8/6/2019 .NET and .NET Framework

    26/32

    VB.NET

    Redesignedfromthe with:

    FullsupportfortheCTS

    AllotherCLRfeatures Classes

    Inheritance

    Methodoverloading

    Itsfunctionallyverym

    roundupfortheCLR,

    chlikeC#

  • 8/6/2019 .NET and .NET Framework

    27/32

    VB.NETExample

    ClassComputeImplementsIMath

    FunctionFactorial(By

    ClassComputeImplementsIMath

    FunctionFactorial(By

    IntegerImplementsIMath.

    DimIAsInteg

    DimResultAs

    ForI=2ToFResult=R

    Next

    IntegerImplementsIMath.

    DimIAsInteg

    DimResultAs

    ForI=2ToFResult=R

    Next

    alFAsInteger)AsalFAsInteger)As

    actorial

    r

    nteger=1

    sult*I

    actorial

    r

    nteger=1

    sult*I

  • 8/6/2019 .NET and .NET Framework

    28/32

    .NETFramework

    Accessiblefromanyla CLR

    WritteninC#

    Organizedintonames Allofwhicharebelowth

    Contains:

    ASP.NET ADO.NET

    WindowsForms

    lassLibrary

    nguagetargetingthe

    aces eSystemnamespace

    A Small Part of th System

  • 8/6/2019 .NET and .NET Framework

    29/32

    ASmallPartofth Namespace

    System

    Int32,

    Data WindowsWeb,

    Connection,DataSet,

    UI Services Forms

    System

    XML EnterpriseServices

    XmlDocument,

    ServicedComponent,

    NET vs Java : St ndard

  • 8/6/2019 .NET and .NET Framework

    30/32

    .NETvs.Java :St Libraries

    .NETFrameworkclas DefinedbyMicrosoft

    SomewhatWindows-ori

    Organizedintoahierarc J2EE

    DefinedbySunandthe

    Notboundtoanyoperat

    Definedaspackagesan

    ndard

    library

    nted

    hyofnamespaces

    JavaCommunityProcess

    ingsystem

    dinterfaces

    J2EE and NET Architectures

  • 8/6/2019 .NET and .NET Framework

    31/32

    J2EEand.NETArchit ectures

  • 8/6/2019 .NET and .NET Framework

    32/32

    Summary

    NETFrameworkconsists .NETissetoftechnologie

    allthesetechnologies.

    CLRensuresadherencet

    JITcompilerconvertsILin CLRmanagessecurity,th .NETisthefutureofapplic

    Windows

    fCLRandtheFCL ,.NETFrameworkiscoreof

    theCLS

    assemblytonativecode. eads,GC ationdevelopmenton