Dot Net Training Dot Net35

37
© Copyright GlobalLogic 2007 1 Microsoft .Net Framework 3.x

description

 

Transcript of Dot Net Training Dot Net35

Page 1: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

1

Microsoft .Net Framework 3.x

Page 2: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

2

Agenda

• Introduction to .Net 3.0 (along with 3.5)

• What's new in .Net 3.0 – A developer perspective

– Introduction to XAML

• The WPF, WCF, WF and Cardspace

• Silverlight

• Demos / Hands on

• Questions and Answers

Page 3: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

3

• .Net 3.0:

– Net combines the power of the .NET Framework 2.0 with new technologies for building applications that have visually compelling user experiences, seamless communication across technology boundaries, and the ability to support a wide range of business processes.

– NET Framework 3.0 is a superset of the .NET Framework, designed to expose the new functionality in Windows Vista® to the developer through managed classes.

Overview to .Net 3.0

Windows Vista (Longhorn) is tightly integrated with .net 3.0 framework. The Look and feel of Vista is enhanced using the WPF.

Page 4: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

4

What's new in .Net 3.0 – A developer perspective

Programming model for Windows .NET Framework 3.0 consists of these basic components:

•.NET Framework 2.0

•Microsoft® Windows® Presentation Foundation (formerly Avalon)

•Microsoft® Windows® Communication Foundation (formerly Indigo)

•Microsoft® Windows® Workflow Foundation

•Windows CardSpace® (formerly code named "Infocard")

Page 5: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

5

What's new in .Net 3.0 – A developer perspective. Contd.

Page 6: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

6

XAML

• One great benefit of XAML is that it helps to separate design and development, which actually helps to improve collaboration and efficiency between designers and software developers. As the XAML markup for an application's UI remains separate from the remainder of application logic, a designer's exact layout can be saved in XAML and combined with the application without affecting the development process.

• Easily toolable, declarative markup

• Code and content are separate

• Can be rendered in the browser / standalone application

• XPS – XML Paper Specification. Microsoft has integrated XPS-based technologies into the 2007 Microsoft Office system and the Microsoft Windows Vista operating system, but XPS itself is platform independent, openly published, and available royalty-free.

Page 7: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

7

XAML

<Button Width="100"> OK <Button.Background> LightBlue </Button.Background></Button>

XAML

Button b1 = new Button();b1.Content = "OK";b1.Background = new SolidColorBrush(Colors.LightBlue);b1.Width = 100;

C#

Dim b1 As New Buttonb1.Content = "OK"b1.Background = New _ SolidColorBrush(Colors.LightBlue)b1.Width = 100

VB.NET

Page 8: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

8

Introduction to XAML

Extensible Application Markup Language

• Microsoft Tools for Designers & Microsoft Tools for Designers & DevelopersDevelopers

• Declarative Programming through Declarative Programming through XAMLXAML

• Third Party Tools (e.g. Aurora by Third Party Tools (e.g. Aurora by Mobiform, ZAM 3D by Electric Rain)Mobiform, ZAM 3D by Electric Rain)Designers designDesigners design

With XAML designers & With XAML designers &

developers can streamline developers can streamline

their collaborationtheir collaborationDevelopers add businessDevelopers add business logiclogic

Page 9: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

9

Windows Presentation Foundation

• WPF is the new presentation API (Application Programming Interface) in .NET Framework 3.0

• The Windows Presentation Foundation is the unified presentation subsystem for Windows. It consists of a display engine and a managed-code framework. The Windows Presentation Foundation unifies how Windows creates, displays, and manipulates documents, media, and user interface, which enables developers and designers to create visually-stunning, differentiated user experiences that improve customer connection.

• Developers can program directly against the API with .NET, instantiate (render) WPF objects by expressing them in XAML, or employ a mixture of XAML with .NET code behind.

Page 10: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

10

WPF Architecture

Application Services

Deployment Services

Databinding

USER INTERFACE SERVICES

XAML

Accessibility

Property System

Input & Eventing

BASE SERVICES

DOCUMENT SERVICES

Packaging Services

XPS Documents

Animation

2D

3D

AudioImaging

Text

VideoEffects

Composition Engine

MEDIA INTEGRATION LAYER

Controls

Layout

Win

do

ws

Pre

sen

tatio

n F

ou

nd

atio

n

XP

S V

iew

er

Property Engine

Input / Eventing System

.NET Framework 2.0

Desktop Windows Manager

Media Integration Layer

DirectX

Windows Vista Display Driver (LDDM)

Windows Media Foundation

Composition Engine

Print Spooler

ManagedUnmanaged

Page 11: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

11

WPF

• WPF fundamentally is designed to create dynamic, data driven presentation systems. Every part of the system is designed to create objects through property sets that drive behavior. Data binding is a fundamental part of the system, and is integrated at every layer.

Page 12: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

12

Demo

• “Hello World” Application:- Starting with pure XAML (Declarative programming model).

• Attaching events. Understanding the new event model of .Net 3.0.

• Bit of Animation.• XPS capabilities

Page 13: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

13

Silverlight

Silverlight is a new cross-browser, cross-platform implementation of the .NET Framework for building and delivering the next generation of media experiences and rich interactive applications (RIA) for the Web. Silverlight unifies the capabilities of the server, the Web, and the desktop, of managed code and dynamic languages, of declarative and traditional programming, and the power of Windows Presentation Foundation (WPF).

Silverlight enables following features:• It is a cross-browser, cross-platform technology. It runs in all popular Web

browsers, including Microsoft Internet Explorer, Flock, Mozilla Firefox, Apple Safari, and Opera, and on Microsoft Windows and Apple Mac OS X.

• It provides a consistent experience no matter where it runs.• It is supported by a very small download that installs in seconds.• It streams video and audio. It scales video quality to everything from mobile

devices to desktop browsers.• It includes compelling graphics that users can manipulate—drag, turn, zoom—

directly in the browser. • It reads data and updates the display, but it doesn't interrupt the user by

refreshing the whole page.

Page 14: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

14

Silverlight

How Silverlight offers features:• WPF and XAML. Silverlight includes Windows Presentation Foundation (WPF)

technology, which greatly extends the elements in the browser for creating UI. WPF lets you create graphics, animation, media, and other rich client features, extending browser-based UI beyond what is available with HTML alone. Extensible Application Markup Language (XAML) provides a declarative markup syntax for creating WPF elements.

• Extensions to JavaScript. Silverlight provides extensions to the universal browser scripting language that provide powerful control over the browser UI, including the ability to work with WPF elements.

• Cross-browser, cross-platform support. Silverlight runs the same on all popular browsers (on any platform). You can design and develop your application without having to worry about which browser or platform your users have.

• Integration with existing applications. Silverlight integrates seamlessly with existing JavaScript and ASP.NET AJAX code to complement functionality already created.

• Access to the .NET Framework programming model and to associated tools. Silverlight-based applications may be created using dynamic languages such as Managed JScript and IronPython as well as languages such as C# and Visual Basic. Development tools such as Visual Studio can be leveraged to create Silverlight-based applications.

Page 15: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

15

Silverlight

• LINQ. Silverlight includes language-integrated query (LINQ), which enables data access using intuitive native syntax and strongly typed objects in .NET Framework languages.

Server-based resources in ASP.NET can be created to use the AJAX capabilities of ASP.NET to interact with server-based resources without interrupting the user.

Page 16: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

16

Silverlight

Page 17: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

17

Silverlight

Page 18: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

18

Silverlight

• Silverlight RIA – Light up my web

• Silverlight and ASP .NET , AJAX

Page 19: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

19

Windows Communication Foundation

• The WCF is an incremental, yet evolutionary technology that brings all the formerly distinct and separate Microsoft connectivity technologies together under a single umbrella within the System.ServiceModel namespace. Included in WCF are Web services (ASMX), the Web service Extensions (WS*), Microsoft Message Queuing (MSMQ), Enterprise Services, COM+, and .NET Remoting using Windows Communication Foundation's System.ServiceModel namespace

• Having a single namespace that subsumes all of these into a coherent package is enormously useful, and makes designing, developing, and deploying applications that require connectivity far simpler.

• Whether the application connects via loosely coupled Web services, or tightly coupled Enterprise Services, the coding model will be consistent and the transition between different communication types will be smoother

Page 20: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

20

The ABC of WCF

ABC means that writing (and configuring) a WCF service is always a three-step process

• Define a contract and implement it on a service • Choose or define a service binding that selects a transport along with quality of

service, security and other options • Deploy an endpoint for the contract by binding it (using the binding definition,

hence the name) to a network address.

• "A" stands for Address—as expressed in the wsdl:service section and links wsdl:binding to a concrete service endpoint address.

• "B" stands for Binding—as expressed in the wsdl:binding section and binds a wsdl:portType contract description to a concrete transport, an envelope format and associated policies.

• "C" stands for Contract—as expressed in the wsdl:portType, wsdl:message and wsdl:type sections and describes types, messages, message exchange patterns and operations.

Page 21: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

21

WCF

Endpoints - All communications with the WCF service will happen via the endpoints. The endpoint is composed of 3 parts (collectively called as ABC's of endpoint) as defines below:

• Address: The endpoints specify a Address that defines where the endpoint is hosted. • Contract: The endpoints specify a Contract that defines which methods of the Service

class will be accessible via the endpoint; each endpoint may expose a different set of methods.

• Binding: The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted.Various components of the WCF are depicted in the figure below.

Page 22: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

22

WCF

Page 23: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

23

WCF

Contracts and Descriptions

• Contracts define various aspects of the message system. The data contract describes every parameter that makes up every message that a service can create or consume. The message parameters are defined by XML Schema definition language (XSD) documents, enabling any system that

understands XML to process the documents. • Service Contracts - Describes the operations a service can perform. Maps

CLR types to WSDL.

• Data Contracts - Describes a data structure. Maps CLR types to XSD. • Message Contracts - Defines the structure of the message on the wire.

Maps CLR types to SOAP messages.

• Bindings can be defined in config file as well as programmatically.

Page 24: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

24

WCF

Service Runtime• The service runtime layer contains the behaviors that occur only during the

actual operation of the service, that is, the runtime behaviors of the service. • Throttling controls how many messages are processed, which can be varied if

the demand for the service grows to a preset limit. • An error behavior specifies what occurs when an internal error occurs on the

service, for example, by controlling what information is communicated to the client.

• Metadata behavior governs how and whether metadata is made available to the outside world.

• Instance behavior specifies how many instances of the service can be run (for example, a singleton specifies only one instance to process all messages).

• Transaction behavior enables the rollback of transacted operations if a failure occurs. Dispatch behavior is the control of how a message is processed by the WCF infrastructure.

• Extensibility enables customization of runtime processes. For example, message inspection is the facility to inspect parts of a message, and parameter filtering enables preset actions to occur based on filters acting on message headers.

Page 25: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

25

A Performance Comparison of WCF with Existing Distributed Communication Technologies

• ASP.NET Web Services (ASMX) : WCF is 25%—50% faster than ASP.NET Web Services

• Web Services Enhancements (WSE) : The throughput of WCF is nearly 4 times better than WSE. The main reason for this is that WSE uses the System.Xml.XmlDocument class to do message level parsing, thereby loading the full message into memory at once, while WCF uses a streaming System.Xml.XmlReader class that improves the performance significantly

• .NET Enterprise Services (ES) : .NET Enterprise Service is load dependant, as in one case WCF is nearly 100% faster but in another scenario it is nearly 25% slower.

• .NET Remoting: approximately 25% faster than .NET Remoting

http://msdn2.microsoft.com/en-us/library/bb310550.aspx

Page 26: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

26

DEMO-WCF

• Hello world

• Using svcutil

Page 27: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

27

Windows WorkFlow

• Windows Workflow Foundation provides a common framework for building workflows into Microsoft Windows applications, whether those workflows coordinate interactions among software, interactions among people, or both

• Unlike traditional Microsoft® .NET Framework programs, workflow-based programs are typically specified in a declarative Extensible Application Markup Language (XAML) document that specifies the structure of the program in terms of domain- specific activities. These activities are typically implemented in a traditional common language runtime (CLR)-based programming language such as C# or Visual Basic

• A workflow can be defined either purely in XAML or with XAML plus a codebehind file that contains C# or Visual Basic code. Pure XAML workflows have the advantage of being directly loadable at run time without a separate compilation step.

• Future releases of other Microsoft products, including BizTalk Server and Microsoft Business Solutions, will also implement their workflow services using Windows Workflow Foundation. And since all of these applications will eventually use the same workflow technology, the advent of Windows Workflow Foundation should make it easier to implement business processes that rely on multiple Windows applications.

• It's important to understand that Windows Workflow Foundation is a framework targeting developers, not a workflow application intended for immediate use by end users.

Page 28: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

28

WorkFlow components

• Activity—A unit of work. The work an activity implements can range from very simple to quite complex.

• Workflow—A group of activities that implements all or part of a business process.

• WWF designers—Graphical tools that can be used to create and modify workflows and activities.

• WWF base activity library—A fundamental group of activities that developers can use to create workflows.

• WWF runtime engine—A library that executes workflows. The runtime engine also provides other services, such as mechanisms for communicating with software outside the workflow.

Page 29: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

29

WorkFlow components

• Host process—A Windows application that hosts the Windows Workflow Foundation runtime engine and any workflows it executes. The host process provides supporting runtime services for persisting a workflow's state, handling transactions, and other functions.

• Rules Engine: Windows Workflow Foundation has a rules engine which enables declarative, rule-based development for workflows and any .NET application to use.

• Workflow Designer: Allows for the graphical composition of workflows, by placing activities within the workflow model. One interesting feature of the designer is that it can be re-hosted within any Windows Forms application.

Page 30: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

30

Demo Session

• Hello World Application:- Creating an Activity and an Simple Sequence Workflow.

• Hosting the Workflow

Page 31: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

31

Windows CardSpace (Infocard)

• Windows CardSpace enables users to provide their digital identities in a familiar, secure and easy way. In the physical world we use business cards, credit cards and membership cards. Online with CardSpace we use a variety of virtual cards to identify ourselves, each retrieving data from an identity provider

Windows CardSpace Provides• Support for any digital identity system • Consistent user control of digital identity • Replacement of password-based Web login :Because the security tokens issued

by most identity providers, including those created by CardSpace's self-issued identity provider, don't use passwords, relying parties, including websites and others, can use these tokens rather than passwords to authenticate their users. If a site doesn't use passwords, phishers can't trick users into revealing those passwords

• Improved user confidence in the identity of remote applications

Page 32: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

32

Interactions among the user, identity provider, and relying party roles

Page 33: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

33

Interactions among the user, identity provider, and relying party role

SCSF recipe implementing MVP

Page 34: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

34

Replacement of password-based Web login

Page 35: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

35

Summary

• NET Framework 3.0 consists of these basic components:

– Microsoft® Windows® Presentation Foundation (formerly Avalon)

– Microsoft® Windows® Communication Foundation

(formerly Indigo)

– Microsoft® Windows® Workflow Foundation

– Windows CardSpace® (formerly code named "Infocard")

• .NET Framework 3.0 is a superset of the .NET Framework, designed to expose the new functionality in Windows Vista® to the developer through managed classes.

• XAML provides declarative markup to separate code and presentation layer

Page 36: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

36

References

• http://msdn2.microsoft.com/en-us/netframework/default.aspx

• http://www.gotdotnet.com/

• Email: [email protected]

Page 37: Dot Net Training Dot Net35

© Copyright GlobalLogic 2007

37

Questions and Answers