Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

Post on 21-Dec-2015

219 views 2 download

Transcript of Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

Architecting data-driven applications with Silverlight 2 (it rocks!)Ronnie SaurenmannPrincipal ArchitectMicrosoft Switzerlandronnies@microsoft.com

Web Services

SOAP 1.1 Basic profileA few restrictions (e.g. SOAP Faults not supported)

Asynchronous invocationFollows cross-domain policy restrictionsGenerated proxies support data binding

Networking Asynchronous HTTP requests

GET/POST Access to most headers, cookies,

Uses browser networking stack Caching, authentication, proxy, compression

TCP only Asynchronous API No explicit bind and no listen/accept support Restricted ports ( 4502-4534) cross-domain support

Sockets

DEMO

DAL & Service Layer

DatabindingTwo way data binding from User interface to business objects Notification via INotifyPropertyChangedDataContext is inherited via Visual TreeFrom XAML <TextBlock Text="{Binding Nasdaq.Points, Mode=OneWay}"/>

From code Binding binding = new Binding("Nasdaq.Points");binding.Mode = BindingMode.OneWay;TextBlock tb = new TextBlock();tb.SetBinding(TextBlock.TextProperty, binding);

DEMO

First UI

Binding with Data Templates

Data Template:

DEMO

Data Templates

LINQ in SilverlightLINQ = Language INtegrated Query

Allows query expressions to benefit from compile-time syntax checking, static typing & Intellisense

Supports querying of in-memory data sourcesSupports querying of XML

var filteredPlayers = from p in players where p.HomeRuns > 20 orderby p.HomeRuns descending select p;

Return all players with more than twenty home runs, sorted

DEMO

LINQ , Autocomplete & Animations

Silverlight toolkit (CTP)

AutocompleteTreeviewViewboxWrappanelChart

DEMO

Chart

Authentication and Authorization

Intranet app in a Windows Domain Simply have Windows Authentication enabled on your Web Site

Every call to a Web Service is authenticated with the client logged in user

Use Role Based security inside WCF or ASMX services to protect the business logicIf you need to do UI Role checking on the client you can create a simple Web Service that sends back the user roles

Authentication and AuthorizationInternet or Intranet app not in AD domain

If Silverlight app it is an island inside an ASP.NET app you must do nothing

Simply relay on your current ASP.NET Forms Authentication controls and functionality

Pure Silverlight appNew in ASP.NET 3.5 the Membership Provider can be exposed as a set of Web Services

Enable the Auth Web Services in web.configEnable Forms Authentication on the serverDesign a Login UI in Silverlight

Call the Auth Service

Use Role Based security inside WCF or ASMX servicesUse SSL!

DEMO

Authentication

Futures

Business Application Frameworks

Base Frameworks

Base Platform

New Silverlight & WPF ComponentsFirst CTP next year at Mix

Network /Services

ControlsData

Binding

CLR

Core UI Engine

Data Shaping• XML• LINQ

Business Logic

Validation

App Services

Navigation

Data Loading

Control Model

Business Controls

Business Logic FrameworkMaking n-tier simpler

Data Access Layer

Business Logic

Business Logic

View

Server

Client

Business Logic Patterns that Grow Unified client/server model Common infrastructure built

in Astoria/WCF for services

transport

Broad Support in Presentation Silverlight, WPF New – validation, controls,

navigation

Works with any Data Access Layer Entity Framework LINQ to SQL ADO.NET nHibernate, etc..

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.