Ronnie Saurenmann Principal Architect Microsoft Switzerland [email protected].

19
Architecting data- driven applications with Silverlight 2 (it rocks!) Ronnie Saurenmann Principal Architect Microsoft Switzerland [email protected]
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    219
  • download

    2

Transcript of Ronnie Saurenmann Principal Architect Microsoft Switzerland [email protected].

Page 1: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

Architecting data-driven applications with Silverlight 2 (it rocks!)Ronnie SaurenmannPrincipal ArchitectMicrosoft [email protected]

Page 2: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@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

Page 3: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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

Page 4: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

DEMO

DAL & Service Layer

Page 5: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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);

Page 6: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

DEMO

First UI

Page 7: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

Binding with Data Templates

Data Template:

Page 8: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

DEMO

Data Templates

Page 9: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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

Page 10: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

DEMO

LINQ , Autocomplete & Animations

Page 11: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

Silverlight toolkit (CTP)

AutocompleteTreeviewViewboxWrappanelChart

Page 12: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

DEMO

Chart

Page 13: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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

Page 14: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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!

Page 15: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

DEMO

Authentication

Page 16: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

Futures

Page 17: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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

Page 18: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

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..

Page 19: Ronnie Saurenmann Principal Architect Microsoft Switzerland ronnies@microsoft.com.

© 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.