300 likes | 569 Views
CL07. Mastering WCF RIA Services. Dinesh Kulkarni Program Manager Developer Division Microsoft Corporation. Agenda. WCF RIA Services in context A look “under the hood” Using RIA Services effectively. Agenda. WCF RIA Services in context A look “under the hood”
E N D
CL07 Mastering WCF RIA Services Dinesh Kulkarni Program Manager Developer Division Microsoft Corporation
Agenda • WCF RIA Services in context • A look “under the hood” • Using RIA Services effectively
Agenda • WCF RIA Services in context • A look “under the hood” • Using RIA Services effectively
RIA Services in n-tier applications Trust Boundary Framework, tools and services with prescriptive pattern for n-tier applications Web Service Data Access Layer (DAL) App Logic App Logic View Database
Windows Communication Foundation (WCF) Programming Model Core Services Web HTTP Services Data Services RIA Services Workflow Services Service Model Data Contract Service Contract Service Behavior Channel Model Formats (Atom, JSON, XML,…) Transports (HTTP, TCP, …) Protocols (SOAP, HTTP, OData, …)
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
Data access & presentation neutral App Logic XML,JSON, Binary
Agenda • WCF RIA Services in context • A look “under the hood” • Using RIA Services effectively
Agenda • WCF RIA Services in context • A look “under the hood” • Design-time view • Run-time view • Services • Using RIA Services effectively
Agenda • WCF RIA Services in context • A look “under the hood” • Design-time view • Run-time view • Services • Using RIA Services effectively
Design-time view Solution (Application) Client project Server project Entities Entities Data Access Layer (DAL) Views DomainService DomainContext Build, reflect & code-gen
Design-time view Demo Writing app logic and using generated code
Code gen recap … Server project Client project Generated code DishViewDomainContext: DomainContext class Plate: Entity EntityQuery<Plate> GetPlatesQuery(…) CreateEntitySet<Plate>(EntitySetOperations.Edit) Restaurant.FeatureOnSite(); [EnableClientAccess()] DishViewDomainService: DomainService IQueryable<Plate> GetPlates(…) void UpdatePlate(Plate p) void FeatureOnSite(Restaurant r)
Agenda • WCF RIA Services in context • A look “under the hood” • Design-time view • Run-time view • Services • Using RIA Services effectively
Run-time view (entity lifecycle) Application Silverlight Web server DomainContext DomainService Data Access Layer (DAL) Views Query Entities Entities Submit Submit Results Results Load context.Load(GetRestaurantsQuery(…).Skip(10).Take(10)) context.SubmitChanges() GetRestaurants(…).Skip(10).Take(10) Submit(changeSet)
Run-time view Demo Query w/ LINQ & CUD w/ unit of work
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
Agenda • WCF RIA Services in context • A look “under the hood” • Design-time view • Run-time view • Services • Using RIA Services effectively
Services • Authentication • Roles • User profile • All integrate w/ ASP.NET infrastructure
Services Demo Authentication and roles
Summary • Authentication & roles • Declarative: class / method-level • Integrated into Query / Submit processing
Agenda • WCF RIA Services in context • A look “under the hood” • Using RIA Services effectively
Using RIA Services effectively Do Don’t Deploy with anon access Expose non-essential entities/ operations or allow free-form access to data Use a single large DomainService class • 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
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/
YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com
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/learn Built by Developers for Developers….
Microsoft Confidential Using the right tool for the job All programming models can leverage the wide-ranging set of behaviors and protocols We have good integration in SL4/Dev10, that gets even better in Dev11