60

DotNet Framework

  • Upload
    d4anmol

  • View
    40

  • Download
    2

Embed Size (px)

DESCRIPTION

A complete tutorial (presentation) document on the Introduction to the .NET Framework. It is a slide presentation which briefly touches upon the topics found in the tutorial document. So, don't fear - just go through it at once. I promise you that u love this presentation.

Citation preview

Page 1: DotNet Framework
Page 2: DotNet Framework

Microsoft Microsoft .NET Framework.NET Framework

OverviewOverview

Svetlin NakovSvetlin Nakov

Software Development Consultant,Software Development Consultant,Part-time Computer Science LecturerPart-time Computer Science Lecturer

Sofia UniversitySofia University“St. Kliment Ohridski”“St. Kliment Ohridski”

http://www.nakov.comhttp://www.nakov.com

Page 3: DotNet Framework

.NET Enterprise Vision

ERP & BillingCustomerService

Sales

UsersAny device,Any place,Any time

XML Web ServicesIntegrate business applications and processes

Back OfficeHeterogeneous application and server infrastructure

SchedulingAuthentication

Notification

Page 4: DotNet Framework

So what is .NET?So what is .NET?

.NET is a platform that provides a .NET is a platform that provides a standardized set of services.standardized set of services. It’s just like Windows, except It’s just like Windows, except

distributed over the Internet.distributed over the Internet. It exports a common interface so that It exports a common interface so that

it’s programs can be run on any it’s programs can be run on any system that supports .NET.system that supports .NET.

A specific software frameworkA specific software framework Includes a common runtimeIncludes a common runtime

.NET is a platform that provides a .NET is a platform that provides a standardized set of services.standardized set of services. It’s just like Windows, except It’s just like Windows, except

distributed over the Internet.distributed over the Internet. It exports a common interface so that It exports a common interface so that

it’s programs can be run on any it’s programs can be run on any system that supports .NET.system that supports .NET.

A specific software frameworkA specific software framework Includes a common runtimeIncludes a common runtime

Page 5: DotNet Framework

.NET Framework.NET Framework.NET Framework.NET Framework

Programming model for .NETProgramming model for .NET Platform for running .NET managed Platform for running .NET managed

code in a virtual machinecode in a virtual machine Provides a very good environment Provides a very good environment

to develop networked applications to develop networked applications and Web Servicesand Web Services

Provides programming API and Provides programming API and unified language-independent unified language-independent development frameworkdevelopment framework

Programming model for .NETProgramming model for .NET Platform for running .NET managed Platform for running .NET managed

code in a virtual machinecode in a virtual machine Provides a very good environment Provides a very good environment

to develop networked applications to develop networked applications and Web Servicesand Web Services

Provides programming API and Provides programming API and unified language-independent unified language-independent development frameworkdevelopment framework

Page 6: DotNet Framework

The Core of .NETThe Core of .NET Framework: Framework: FCL & CLRFCL & CLR Common Language RuntimeCommon Language Runtime

Garbage collectionGarbage collection Language integrationLanguage integration Multiple versioning support Multiple versioning support

(no more DLL hell!)(no more DLL hell!) Integrated securityIntegrated security

Framework Class LibraryFramework Class Library Provides the core functionality:Provides the core functionality:

ASP.NET, Web Services, ADO.NET, ASP.NET, Web Services, ADO.NET, Windows Forms, IO, XML, etc.Windows Forms, IO, XML, etc.

Page 7: DotNet Framework

.NET Framework.NET Framework Common Language RuntimeCommon Language Runtime

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

CLR manages code execution CLR manages code execution at runtimeat runtime

Memory management, thread Memory management, thread management, etc.management, etc.

Page 8: DotNet Framework

.NET Framework.NET Framework Base Class LibraryBase Class Library

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

Object-oriented collection of Object-oriented collection of reusable typesreusable types

Collections, I/O, Strings, …Collections, I/O, Strings, …

Page 9: DotNet Framework

.NET Framework.NET Framework Data Access LayerData Access Layer

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

ADO .NET and XMLADO .NET and XML

Access relational databasesAccess relational databases Disconnected data modelDisconnected data model Work with XMLWork with XML

Page 10: DotNet Framework

.NET Framework.NET Framework ASP.NET & Windows FormsASP.NET & Windows Forms

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

ADO .NET and XMLADO .NET and XML

ASP .NETASP .NETWeb Forms Web ServicesWeb Forms Web Services

Mobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

Create application’s front-end – Create application’s front-end – Web-based user interface, Web-based user interface, Windows GUI, Web services, …Windows GUI, Web services, …

Page 11: DotNet Framework

.NET Framework.NET Framework Programming LanguagesProgramming Languages

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

ADO .NET and XMLADO .NET and XML

ASP .NETASP .NETWeb Forms Web ServicesWeb Forms Web Services

Mobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

C++C++ C#C# VB.NETVB.NET PerlPerl J#J# ……

Use your favorite languageUse your favorite language

Page 12: DotNet Framework

.NET Framework.NET Framework Common Language SpecificationCommon Language Specification

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

ADO .NET and XMLADO .NET and XML

ASP .NETASP .NETWeb Forms Web ServicesWeb Forms Web Services

Mobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

Common Language SpecificationCommon Language SpecificationC++C++ C#C# VBVB PerlPerl J#J# ……

Page 13: DotNet Framework

.NET Framework.NET Framework Visual Studio .NETVisual Studio .NET

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

ADO .NET and XMLADO .NET and XML

ASP .NETASP .NETWeb Forms Web ServicesWeb Forms Web Services

Mobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

Common Language SpecificationCommon Language Specification

C++C++ C#C# VBVB PerlPerl J#J# ……

Visu

al S

tud

io .N

ET

Visu

al S

tud

io .N

ET

Page 14: DotNet Framework

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

.NET Framework (Base Class Library).NET Framework (Base Class Library)

ADO .NET and XMLADO .NET and XML

ASP .NETASP .NETWeb Services Web FormsWeb Services Web Forms

Mobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

Common Language SpecificationCommon Language Specification

C++C++ C#C# VBVB PerlPerl J#J# ……

Visu

al S

tud

io .N

ET

Visu

al S

tud

io .N

ET

Open LanguageOpen LanguageSpecificationSpecification

C# Language – C# Language – Submitted to ECMASubmitted to ECMA

XML-basedXML-baseddata accessdata access

Web services –Web services –XML, SOAP-basedXML, SOAP-based

.NET Framework.NET Framework Standards ComplianceStandards Compliance

Page 15: DotNet Framework

Common Language RuntimeCommon Language RuntimeCommon Language RuntimeCommon Language Runtime Manages running code – like a virtual Manages running code – like a virtual

machinemachine ThreadingThreading Memory managementMemory management No interpreter: JIT-compiler produces No interpreter: JIT-compiler produces

native code – during the program native code – during the program installation or at run timeinstallation or at run time

Fine-grained evidence-based securityFine-grained evidence-based security Code access securityCode access security

Code can be verified to guarantee type safetyCode can be verified to guarantee type safety No unsafe casts, no un-initialized variables and No unsafe casts, no un-initialized variables and

no out-of-bounds array indexing no out-of-bounds array indexing Role-based securityRole-based security

Manages running code – like a virtual Manages running code – like a virtual machinemachine ThreadingThreading Memory managementMemory management No interpreter: JIT-compiler produces No interpreter: JIT-compiler produces

native code – during the program native code – during the program installation or at run timeinstallation or at run time

Fine-grained evidence-based securityFine-grained evidence-based security Code access securityCode access security

Code can be verified to guarantee type safetyCode can be verified to guarantee type safety No unsafe casts, no un-initialized variables and No unsafe casts, no un-initialized variables and

no out-of-bounds array indexing no out-of-bounds array indexing Role-based securityRole-based security

Page 16: DotNet Framework

Managed CodeManaged Code

Code that targets the CLR is referred to Code that targets the CLR is referred to as managed codeas managed code

All managed code has the features of All managed code has the features of the CLRthe CLR

Object-orientedObject-oriented Type-safeType-safe Cross-language integrationCross-language integration Cross language exception handlingCross language exception handling Multiple version supportMultiple version support

Managed code is represented in special Managed code is represented in special Intermediate Language (IL)Intermediate Language (IL)

Page 17: DotNet Framework

Automatic Memory ManagementAutomatic Memory Management

The CLR manages memory for managed codeThe CLR manages memory for managed code All allocations of objects and buffers made from All allocations of objects and buffers made from

a a Managed HeapManaged Heap Unused objects and buffers are cleaned up Unused objects and buffers are cleaned up

automatically through automatically through Garbage CollectionGarbage Collection

Some of the worst bugs in software Some of the worst bugs in software development are not possible with managed development are not possible with managed codecode

Leaked memory or objectsLeaked memory or objects References to freed or non-existent objectsReferences to freed or non-existent objects Reading of uninitialised variablesReading of uninitialised variables

PointerlessPointerless environment environment

Page 18: DotNet Framework

Multiple Language SupportMultiple Language Support

IL (MSIL or CIL) – Intermediate LanguageIL (MSIL or CIL) – Intermediate Language It is low-level (machine) language, like It is low-level (machine) language, like

Assembler, but is Object-orientedAssembler, but is Object-oriented CTS is a rich type system built into the CLRCTS is a rich type system built into the CLR

Implements various types (Implements various types (intint, float, string, …), float, string, …) And operations on those typesAnd operations on those types

CLS is a set of specifications that all CLS is a set of specifications that all languages and libraries need to followlanguages and libraries need to follow This will ensure interoperability between This will ensure interoperability between

languageslanguages

Page 19: DotNet Framework

Intermediate LanguageIntermediate Language .NET languages are compiled to an .NET languages are compiled to an

Intermediate Language (IL)Intermediate Language (IL) IL is also known as MSIL or CILIL is also known as MSIL or CIL CLR compiles IL in just-in-time (JIT) CLR compiles IL in just-in-time (JIT)

manner – each function is compiled manner – each function is compiled just before executionjust before execution

The JIT code stays in memory for The JIT code stays in memory for subsequent callssubsequent calls

Recompilations of assemblies are Recompilations of assemblies are also possiblealso possible

Page 20: DotNet Framework

Example of MSIL CodeExample of MSIL Code

.method private hidebysig static void Main() .method private hidebysig static void Main() cil managedcil managed

{{ .entrypoint.entrypoint // Code size 11 (0xb)// Code size 11 (0xb) .maxstack 8.maxstack 8 IL_0000: ldstr "Hello, world!"IL_0000: ldstr "Hello, world!" IL_0005: call void IL_0005: call void

[mscorlib]System.Console::WriteLine(string)[mscorlib]System.Console::WriteLine(string) IL_000a: retIL_000a: ret} // end of method HelloWorld::Main} // end of method HelloWorld::Main

Page 21: DotNet Framework

Common Type System (CTS)Common Type System (CTS)

All .NET languages have the same primitive All .NET languages have the same primitive data types. An data types. An intint in C# is the same as an in C# is the same as an intint in VB.NETin VB.NET

When communicating between modules When communicating between modules written in any .NET language, the types are written in any .NET language, the types are guaranteed to be compatible on the binary guaranteed to be compatible on the binary levellevel

Types can be:Types can be: Value types – passed by value, stored in the Value types – passed by value, stored in the

stackstack Reference types – passed by reference, stored Reference types – passed by reference, stored

in the heapin the heap Strings are a primitive data type nowStrings are a primitive data type now

Page 22: DotNet Framework

Common Language Common Language Specification (CLS)Specification (CLS)

Any language that conforms to the CLS Any language that conforms to the CLS is a .NET languageis a .NET language

A language that conforms to the CLS A language that conforms to the CLS has the ability to take full advantage of has the ability to take full advantage of the Framework Class Library (FCL)the Framework Class Library (FCL)

CLS is standardized by ECMACLS is standardized by ECMA

Page 23: DotNet Framework

.NET Languages.NET Languages

Languages provided by MicrosoftLanguages provided by Microsoft C++, C#, J#, VB.NET, C++, C#, J#, VB.NET, JScriptJScript

Third-parties languagesThird-parties languages Perl, Python, Pascal, APL, COBOL, Eiffel, Perl, Python, Pascal, APL, COBOL, Eiffel,

Haskell, ML, Oberon, Scheme, Smalltalk…Haskell, ML, Oberon, Scheme, Smalltalk…

Advanced multi-language featuresAdvanced multi-language features Cross-language inheritance and Cross-language inheritance and

exceptions handlingexceptions handling

Object system is built in, not bolted onObject system is built in, not bolted on No additional rules or API to learnNo additional rules or API to learn

Page 24: DotNet Framework

C# LanguageC# Language Mixture between C++, Java and DelphiMixture between C++, Java and Delphi Component-orientedComponent-oriented

Properties, Methods, EventsProperties, Methods, Events Attributes, XML documentationAttributes, XML documentation All in one place, no header files, IDL, etc.All in one place, no header files, IDL, etc. Can be embedded in ASP+ pagesCan be embedded in ASP+ pages

Everything really is an objectEverything really is an object Primitive types aren’t magicPrimitive types aren’t magic Unified type system == Deep simplicityUnified type system == Deep simplicity Improved extensibility and reusabilityImproved extensibility and reusability

Page 25: DotNet Framework

C# Language – ExampleC# Language – Example

using System;using System;

class HelloWorldclass HelloWorld{{

public static void main()public static void main(){{

Console.WriteLine(“Hello, Console.WriteLine(“Hello, world!”);world!”);}}

}}

Page 26: DotNet Framework

Code Compilation and ExecutionCode Compilation and ExecutionCode Compilation and ExecutionCode Compilation and Execution

CompilationCompilation

Before Before installation or installation or the first time the first time

each method is each method is calledcalled

Before Before installation or installation or the first time the first time

each method is each method is calledcalled

ExecutionExecution

JIT JIT CompilerCompiler

NativeNativeCodeCode

MSILMSILCodeCode

MetadataMetadata

Source Source CodeCode

Language Language CompilerCompiler

Also called Also called AssemblyAssembly(.EXE or(.EXE or.DLL file).DLL file)

Also called Also called AssemblyAssembly(.EXE or(.EXE or.DLL file).DLL file)

Page 27: DotNet Framework

AssembliesAssemblies DLL or EXE fileDLL or EXE file Smallest deployable unit in the CLRSmallest deployable unit in the CLR Have unique version numberHave unique version number No version conflicts (known as DLL hell)No version conflicts (known as DLL hell) Contains IL code to be executedContains IL code to be executed Security boundary – permissions are Security boundary – permissions are

granted at the assembly levelgranted at the assembly level Type boundary – all types include the Type boundary – all types include the

assembly name they are a part ofassembly name they are a part of Self-describing manifest – metadata that Self-describing manifest – metadata that

describes the types in the assemblydescribes the types in the assembly

Page 28: DotNet Framework

Metadata in AssemblyMetadata in Assembly

Type DescriptionsType Descriptions

ClassesClassesBase classesBase classesImplemented interfacesImplemented interfacesData membersData membersMethodsMethods

ClassesClassesBase classesBase classesImplemented interfacesImplemented interfacesData membersData membersMethodsMethods

NameNameVersionVersionCultureCulture

NameNameVersionVersionCultureCulture

Assembly DescriptionAssembly Description

Other assembliesOther assembliesSecurity PermissionsSecurity PermissionsExported TypesExported Types

Other assembliesOther assembliesSecurity PermissionsSecurity PermissionsExported TypesExported Types

Page 29: DotNet Framework

ApplicationsApplications

One or more assembliesOne or more assemblies Assemblies conflict resolutionAssemblies conflict resolution

Using metadataUsing metadata Local (preferred)Local (preferred) Global Assembly Cache (GAC)Global Assembly Cache (GAC)

Different applications may use Different applications may use different versions of an assemblydifferent versions of an assembly Easier software updatesEasier software updates Easier software removalEasier software removal

Page 30: DotNet Framework

Visual Studio .NETVisual Studio .NET Development tool that contains a rich set of Development tool that contains a rich set of

productivity and debugging featuresproductivity and debugging features Supports managed and unmanaged applicationsSupports managed and unmanaged applications Supports C#, C++, VB.NET, …Supports C#, C++, VB.NET, … Many useful tools and wizardsMany useful tools and wizards Windows Forms DesignerWindows Forms Designer ASP.NET Web Forms DesignerASP.NET Web Forms Designer Web Services supportWeb Services support SQL Server integration with ADO.NET and XMLSQL Server integration with ADO.NET and XML

VS.NET is not part of the .NET FrameworkVS.NET is not part of the .NET Framework Not necessary to build or run managed codeNot necessary to build or run managed code The .NET Framework SDK includes command The .NET Framework SDK includes command

line compilersline compilers

Page 31: DotNet Framework

VS.NET – Single Development VS.NET – Single Development Environment & Skill SetEnvironment & Skill Set From Visual Studio.NET you can:From Visual Studio.NET you can:

Write codeWrite code Design user interfaceDesign user interface Study documentationStudy documentation DebugDebug TestTest DeployDeploy

Same tools for all languagesSame tools for all languages Same tools for all platformsSame tools for all platforms

Page 32: DotNet Framework

Visual Studio .NETVisual Studio .NET

Page 33: DotNet Framework

The .NET Framework LibraryThe .NET Framework Library

Base Class LibraryBase Class Library

ADO.NET and XMLADO.NET and XML

Web Forms Web ServicesWeb Forms Web ServicesMobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

ASP.NETASP.NET

Page 34: DotNet Framework

System System

GlobalizationGlobalization

DiagnosticsDiagnostics

ConfigurationConfiguration

CollectionsCollections

ResourcesResources

ReflectionReflection

NetNet

IOIO

ThreadingThreading

TextText

ServiceProcessServiceProcess

SecuritySecurity RuntimeRuntimeInteropServicesInteropServices

RemotingRemoting

SerializationSerialization

System.DataSystem.Data

DesignDesign

ADOADO

SQLTypesSQLTypes

SQLSQL

System.XmlSystem.Xml

XPathXPath

XSLTXSLT SerializationSerialization

System.WebSystem.Web

ConfigurationConfiguration SessionStateSessionState

CachingCaching SecuritySecurity

ServicesServices UIUIHtmlControlsHtmlControls

WebControlsWebControls

DescriptionDescription

DiscoveryDiscovery

ProtocolsProtocols System.DrawingSystem.Drawing

ImagingImaging

Drawing2DDrawing2D

TextText

PrintingPrinting

System.WinFormsSystem.WinForms

DesignDesign ComponentModelComponentModel

.NET Framework Namespaces.NET Framework Namespaces

Page 35: DotNet Framework

Base Class Library NamespacesBase Class Library Namespaces

SystemSystem

ThreadingThreading

TextText

ServiceProcessServiceProcess

SecuritySecurity

ResourcesResources

ReflectionReflection

NetNet

IOIO

GlobalizationGlobalization

DiagnosticsDiagnostics

ConfigurationConfiguration

CollectionsCollections

RuntimeRuntime

SerializationSerialization

RemotingRemoting

InteropServicesInteropServices

Page 36: DotNet Framework

Base Class LibraryBase Class Library

Data types, conversions, formattingData types, conversions, formatting Collections: Collections: ArrayList, HashtableArrayList, Hashtable, etc., etc. Globalization: Cultures, sorting, etc.Globalization: Cultures, sorting, etc. I/O: Binary and text streams, files, etc.I/O: Binary and text streams, files, etc. Networking: HTTP, TCP/IP sockets, etc.Networking: HTTP, TCP/IP sockets, etc. Reflection: Metadata and IL emitReflection: Metadata and IL emit Security: Permissions, cryptographySecurity: Permissions, cryptography Text: Encodings, regular expressionsText: Encodings, regular expressions

Page 37: DotNet Framework

Data And XML NamespacesData And XML Namespaces

System.DataSystem.Data

SQLTypesSQLTypes

SQLClientSQLClient

CommonCommon

OleDbOleDb

System.XmlSystem.Xml

SerializationSerialization

XPathXPath

XSLTXSLT

Page 38: DotNet Framework

ADO.NET And XMLADO.NET And XML ADO.NET consumes all types of dataADO.NET consumes all types of data

XML (hierarchical), relational, etc.XML (hierarchical), relational, etc. Powerful in-memory data cache (DataSet)Powerful in-memory data cache (DataSet)

DataSet contains various data objects: DataSet contains various data objects: tables, views, relations, constraints, etc.tables, views, relations, constraints, etc.

Lightweight, stateless, disconnectedLightweight, stateless, disconnected Supports both relational and XML accessSupports both relational and XML access

High-performance, low overhead stream High-performance, low overhead stream accessaccess

Great XML support including: Great XML support including: W3C DOM, XSL/T, XPath, and SchemaW3C DOM, XSL/T, XPath, and Schema

Page 39: DotNet Framework

VS.NET – DataSet DesignerVS.NET – DataSet Designer

Page 40: DotNet Framework

Windows Forms NamespacesWindows Forms Namespaces

System.DrawingSystem.Drawing

Drawing2DDrawing2D

ImagingImaging

PrintingPrinting

TextText

System.Windows.FormsSystem.Windows.Forms

DesignDesign ComponentModelComponentModel

Page 41: DotNet Framework

Windows FormsWindows Forms Windows Forms is framework for

building rich GUI applications RAD (Rapid Application Development)

component-based event-driven

Rich set of controls Data aware components ActiveX® Support Printing support Unicode support UI inheritance

Page 42: DotNet Framework

Windows FormsWindows Forms

Combines VB and Delphi forms with the Combines VB and Delphi forms with the power of MFCpower of MFC Delegation as well as subclassingDelegation as well as subclassing

Advanced featuresAdvanced features Visual forms inheritance, automatic layoutVisual forms inheritance, automatic layout Advanced graphics support – GDI+Advanced graphics support – GDI+ Easy access to Win32Easy access to Win32®® API API

Controls can be hosted in IE 5.xControls can be hosted in IE 5.x No installation, registration or No installation, registration or GUIDsGUIDs

Code access securityCode access security

Page 43: DotNet Framework

VS.NET – Windows Forms VS.NET – Windows Forms DesignerDesigner

Page 44: DotNet Framework

DemoDemo

Create simple database Create simple database application with:application with:

Windows FormsWindows Forms ADO.NETADO.NET MS SQL ServerMS SQL Server Visual Studio .NETVisual Studio .NET

Page 45: DotNet Framework

ASP.NET NamespacesASP.NET Namespaces

System.WebSystem.Web

CachingCaching

ConfigurationConfiguration

ServicesServices UIUI

SessionStateSessionState

HtmlControlsHtmlControls

WebControlsWebControls

DescriptionDescription

DiscoveryDiscovery

SecuritySecurity

ProtocolsProtocols

Page 46: DotNet Framework

Framework for building Web applications Framework for building Web applications and Web services in any .NET languageand Web services in any .NET language

C#, C++, VB.NET, C#, C++, VB.NET, JScriptJScript, etc., etc.

Automatic multiple clients supportAutomatic multiple clients support DHTML, HTML 3.2, WML, small devicesDHTML, HTML 3.2, WML, small devices

Compilation of ASP.NET Web applications Compilation of ASP.NET Web applications into .NET assembliesinto .NET assemblies

Cached the first time when calledCached the first time when called

All subsequent calls use the cached versionAll subsequent calls use the cached version

Separation of code and contentSeparation of code and content Developers and designers can work independentlyDevelopers and designers can work independently

ASP.NETASP.NET

Page 47: DotNet Framework

ASP.NETASP.NET

Rich page architecture – “Web Forms”Rich page architecture – “Web Forms” Rich set of ASP.NET server controlsRich set of ASP.NET server controls

Data validationData validation Data bound gridsData bound grids

Event-driven execution modelEvent-driven execution model Great Web-services supportGreat Web-services support Easy to deployEasy to deploy High reliability and availabilityHigh reliability and availability High performance and scalabilityHigh performance and scalability Scalable handling of state informationScalable handling of state information

Page 48: DotNet Framework

VS.NET – Web Forms DesignerVS.NET – Web Forms Designer

Page 49: DotNet Framework

DemoDemo

Create simple Web-based Create simple Web-based database application with:database application with:

ASP.NET (Web Forms)ASP.NET (Web Forms) ADO.NETADO.NET MS SQL ServerMS SQL Server Visual Studio .NETVisual Studio .NET

Page 50: DotNet Framework

Web ServicesWeb Services Technical definition – “A programmable Technical definition – “A programmable

application component accessible via application component accessible via standard Web protocols”standard Web protocols” Built on XML and SOAPBuilt on XML and SOAP

Expose functionality from Web SitesExpose functionality from Web Sites Almost like component programming over Almost like component programming over

the Webthe Web Functionality exposed using XML/HTMLFunctionality exposed using XML/HTML

Standard Web Services includeStandard Web Services include CalendarCalendar MSN PassportMSN Passport

Page 51: DotNet Framework

XML Web Services FoundationXML Web Services Foundation

Ubiquitous Communications: InternetUbiquitous Communications: Internet

Universal Data Format:Universal Data Format: XMLXML

Service Interactions:Service Interactions: SOAPSOAP

Publish, Find, Use Services:Publish, Find, Use Services: UDDIUDDI

Simple, Open, Broad Industry SupportSimple, Open, Broad Industry Support Open standards:Open standards:

Page 52: DotNet Framework

ASP.NET Web ServicesASP.NET Web Services Simple programming modelSimple programming model

Author .ASMX files with class methodsAuthor .ASMX files with class methods ASP.NET compiles on demand, generates ASP.NET compiles on demand, generates

WSDL contract, exposes HTML test pageWSDL contract, exposes HTML test page

Incoming HTTP/SOAP messages invoke Incoming HTTP/SOAP messages invoke methodsmethods No special HTTP, SOAP or XML knowledge No special HTTP, SOAP or XML knowledge

requiredrequired

Supports multiple message wire formatsSupports multiple message wire formats HTTP GET, POST, and SOAP RequestsHTTP GET, POST, and SOAP Requests

Page 53: DotNet Framework

Web Service Example in C#Web Service Example in C#ParcelTracker.asmxParcelTracker.asmxParcelTracker.asmxParcelTracker.asmx

<%@ WebService Language="C#" %><%@ WebService Language="C#" %>using System;using System;using System.Web.Services;using System.Web.Services;

public class ParcelTrackerWebServicepublic class ParcelTrackerWebService{{ [WebMethod][WebMethod] public string GetOrderStatus(int orderNumber)public string GetOrderStatus(int orderNumber) {{ //// Implementation hereImplementation here }}}}

<%@ WebService Language="C#" %><%@ WebService Language="C#" %>using System;using System;using System.Web.Services;using System.Web.Services;

public class ParcelTrackerWebServicepublic class ParcelTrackerWebService{{ [WebMethod][WebMethod] public string GetOrderStatus(int orderNumber)public string GetOrderStatus(int orderNumber) {{ //// Implementation hereImplementation here }}}}

Page 54: DotNet Framework

.NET Framework on Linux.NET Framework on Linux Mono ProjectMono Project

Open Source C# compiler, CLR and Framework Open Source C# compiler, CLR and Framework Class LibraryClass Library

Runs on various platforms and hardware:Runs on various platforms and hardware: Linux, Unix, FreeBSD, Windows – JIT-Linux, Unix, FreeBSD, Windows – JIT-

compiler for x86compiler for x86 s390, SPARCs390, SPARC,, PowerPC PowerPC – interpreter for these – interpreter for these

hardware architectureshardware architectures Supports also:Supports also:

ADO.NET and XMLADO.NET and XML Windows Forms (not fully)Windows Forms (not fully) ASP.NETASP.NET Web ServicesWeb Services

Page 55: DotNet Framework

.NET Framework on Linux (2).NET Framework on Linux (2) Mono ProjectMono Project

Runs .NET portable executables on Linux, e.g.Runs .NET portable executables on Linux, e.g.mono myapp.exemono myapp.exe

Compiles .NET applications to portable Compiles .NET applications to portable executables, e.g.executables, e.g.

mcs myapp.csmcs myapp.cs

The obtained .exe file can taken and run on The obtained .exe file can taken and run on WindowsWindows

DotGNU Portable.NETDotGNU Portable.NET Build and execute .NET applications on Build and execute .NET applications on

GNU/LinuxGNU/Linux, , Windows, Solaris, NetBSD, FreeBSD, Windows, Solaris, NetBSD, FreeBSD, and MacOS X and MacOS X

Page 56: DotNet Framework

SummarySummary .NET Framework is a code execution platform .NET Framework is a code execution platform

– the environment which .NET programs run– the environment which .NET programs run .NET Framework consists of two primary .NET Framework consists of two primary

parts: Common Language Runtime and .NET parts: Common Language Runtime and .NET Class LibrariesClass Libraries

The CLS (Common Language Specification) The CLS (Common Language Specification) allows different languages to interact allows different languages to interact seamlessly.seamlessly.

The CTS (Common Type System) allows all The CTS (Common Type System) allows all languages to share base data types.languages to share base data types.

Page 57: DotNet Framework

Summary (2)Summary (2) .NET languages are compiled to MSIL by .NET languages are compiled to MSIL by

their respective compilerstheir respective compilers MSIL code is compiled to machine code by MSIL code is compiled to machine code by

the JIT compilerthe JIT compiler All .NET languages have equal access to the All .NET languages have equal access to the

FCL (Framework Class Library) which is a FCL (Framework Class Library) which is a rich set of classes for developing softwarerich set of classes for developing software

Base Class Library is set of basic classes: Base Class Library is set of basic classes: Collections, I/O, Networking, Security, etc.Collections, I/O, Networking, Security, etc.

ADO.NET provides .NET applications with ADO.NET provides .NET applications with access to relational databasesaccess to relational databases

Page 58: DotNet Framework

Summary (3)Summary (3) .NET has great XML support including: DOM, .NET has great XML support including: DOM,

XSLT, XSLT, XPathXPath, and , and XSchemaXSchema Windows Forms provides GUI interface for Windows Forms provides GUI interface for

the .NET applicationsthe .NET applications ASP.NET allows creating web interface ASP.NET allows creating web interface

to .NET applicationsto .NET applications Web Services expose functionality from web Web Services expose functionality from web

sites and make it remotely accessible sites and make it remotely accessible through standard XML-based protocolsthrough standard XML-based protocols

Visual Studio .NET is powerful development Visual Studio .NET is powerful development IDE for all .NET languages and technologiesIDE for all .NET languages and technologies

Page 59: DotNet Framework

.NET Framework – Resources.NET Framework – Resources Visit following web sites:Visit following web sites:

..NET Framework Home Site – NET Framework Home Site – http://msdn.microsoft.com/netframework/http://msdn.microsoft.com/netframework/

The Microsoft .NET Framework Community – The Microsoft .NET Framework Community – http://www.gotdotnet.com/http://www.gotdotnet.com/

ASP.NET – ASP.NET – http://www.asp.net/http://www.asp.net/ .NET Windows Forms – .NET Windows Forms –

http://www.windowsforms.net/http://www.windowsforms.net/ Code Project – Code Project – http://www.codeproject.net/http://www.codeproject.net/ Mono – Open Source .NET Framework – Mono – Open Source .NET Framework –

http://www.go-mono.org/http://www.go-mono.org/ Rotor – Shared Source .NET CLI – Rotor – Shared Source .NET CLI –

http://msdn.microsoft.com/net/sscli/http://msdn.microsoft.com/net/sscli/ Read the news groups:Read the news groups:

news://news://msnews.microsoft.commsnews.microsoft.com//microsoft.public.dotnet.frameworkmicrosoft.public.dotnet.framework

Page 60: DotNet Framework

Questions?Questions?