data access layer (dal) app logic database view web service app logic trust boundary

30
Mastering WCF RIA Services Dinesh Kulkarni Program Manager Developer Division Microsoft Corporation CL07

Upload: carla-dunnaway

Post on 31-Mar-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Mastering WCF RIA Services

Dinesh KulkarniProgram ManagerDeveloper DivisionMicrosoft Corporation

CL07

Page 2: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”> Using RIA Services effectively

Page 3: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”> Using RIA Services effectively

Page 4: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

RIA Services in n-tier applications

Data Acces

s Layer (DAL)

App Logic

Database

View

Web Servic

e

AppLogic

TrustBoundary

Framework, tools and services withprescriptive pattern for n-tier

applications

Page 5: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Windows Communication Foundation (WCF)

Channel Model

Formats(Atom, JSON, XML,…)

Transports(HTTP, TCP, …)

Protocols(SOAP, HTTP, OData,

…)

Service Model

Data Contract Service ContractService Behavior

Programming Model

Core Services

Web HTTP

Services

Data Services

Workflow Services

RIA Services

Page 6: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Design principles

> End-to-end view of an application: framework, pattern, tooling and services

> Prescriptive approach to app logic > DAL-neutral and targets multiple

presentation technologies

Page 7: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Data access & presentation neutral

AppLogic

XML, JSON, Binary

Page 8: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”> Using RIA Services effectively

Page 9: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”

> Design-time view> Run-time view> Services

> Using RIA Services effectively

Page 10: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”

> Design-time view> Run-time view> Services

> Using RIA Services effectively

Page 11: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Client project

Design-time view

Server project

DomainService

Data Acces

s Layer (DAL)

Entities

Solution (Application)

ViewsDomainContex

t

EntitiesBuild,

reflect & code-gen

Page 12: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Design-time view

Writing app logic and using generated code

Demo

Page 13: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Code gen recap …

Server project

[EnableClientAccess()]DishViewDomainService:

DomainService

IQueryable<Plate> GetPlates(…)

void UpdatePlate(Plate p)

void FeatureOnSite(Restaurant r)

Client projectGenerated code

DishViewDomainContext: DomainContext

class Plate: Entity EntityQuery<Plate>

GetPlatesQuery(…)

CreateEntitySet<Plate>(EntitySetOperations.Edit)

Restaurant.FeatureOnSite();

Page 14: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”

> Design-time view> Run-time view> Services

> Using RIA Services effectively

Page 15: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Silverlight

Run-time view (entity lifecycle)

Web server

DomainService

Data Acces

s Layer (DAL)

Application

ViewsDomain

Context

LoadQuery

Entities

Results

Submit

Entities

Submit

Results

context.Load(GetRestaurantsQuery(…).Skip(10).Take(10))

context.SubmitChanges()

GetRestaurants(…).Skip(10).Take(10)

Submit(changeSet)

Page 16: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Run-time view

Query w/ LINQ & CUD w/ unit of work

Demo

Page 17: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Summary

> Entity lifecycle> Query> Unit of work: insert, delete, update, custom

update> DomainContext

> Bindable collections, entities> Async support> Id management, change tracking

> DomainService> CRUD support> Option of open service layer with WCF

Page 18: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”

> Design-time view> Run-time view> Services

> Using RIA Services effectively

Page 19: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Services

> Authentication> Roles> User profile> All integrate w/ ASP.NET infrastructure

Page 20: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Services

Authentication and roles

Demo

Page 21: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Summary

> Authentication & roles> Declarative: class / method-level> Integrated into Query / Submit processing

Page 22: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Agenda

> WCF RIA Services in context> A look “under the hood”> Using RIA Services effectively

Page 23: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Using RIA Services effectivelyDo> Require authentication /

roles> Authenticate w/ https

> Utilize query composition> Filter, sort, page

> Consider custom update

> Factor into multiple DomainService classes / libraries

> Handle errors on server

> Use declarative validation

Don’t> Deploy with anon access

> Expose non-essential entities/ operations or allow free-form access to data

> Use a single large DomainService class

Page 24: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Call to action

> Try RIA Services bits> Beta on .NET 3.5 SP1/ VS 2008 /

Silverlight 3> Preview on Dev10 / Silverlight 4 (this will

evolve into V1 RTW)> Give us feedback and join us on forum> Home page

> http://silverlight.net/riaservices/

Page 25: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Related sessions

CL21 Building Amazing Business Applications with Microsoft Silverlight and Microsoft .NET RIA Services

CL32 Developing Testable Silverlight Applications

CL22 Advanced Topics for Building Large-Scale Applications with Microsoft Silverlight

CL19 Building LoB Applications with Silverlight 4

FT55 Developing REST Applications with .NET Framework

FT12 ADO.NET Data Services: What’s New with the RESTful Data Services Framework

SVC23 Using the Microsoft Sync Framework to Connect Apps to the Cloud

Page 26: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

YOUR FEEDBACK IS IMPORTANT TO US!

Please fill out session evaluation

forms online atMicrosoftPDC.com

Page 27: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Learn More On Channel 9

> Expand your PDC experience through Channel 9

> Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses

channel9.msdn.com/learnBuilt by Developers for Developers….

Page 28: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

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

Page 29: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary

Using the right tool for the jobWCF Layer Description

Domain Services

Prescriptive E2E experience for Silverlight applications

Data Services Turn-key entity-oriented programming model for HTTP/RESTful services

Workflow Services

Workflow-oriented programming model for long-running business processes

Service Model Method-oriented programming model for WS-* & REST developers1. All programming models can leverage the wide-ranging set of

behaviors and protocols2. We have good integration in SL4/Dev10, that gets even better

in Dev11

Microsoft Confidential

Page 30: Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary