WCF RIA Services - Querying and Updating Data SILVERLIGHTSHOW.NET WEBINARS SERIES BRIAN NOYES, CHIEF ARCHITECT, IDESIGN INC 2 FEB 2011.

Slides:



Advertisements
Similar presentations
Introduction to NHibernate By Andrew Smith. The Basics Object Relation Mapper Maps POCOs to database tables Based on Java Hibernate. V stable Generates.
Advertisements

Microsoft Dynamics® AX 2012
OASIS OData Technical Committee. AGENDA Introduction OASIS OData Technical Committee OData Overview Work of the Technical Committee Q&A.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
Change the Rules Distributed data apps with.NET Zlatko Knezevic Developer Evangelist Microsoft
Jeff Derstadt Senior Development Lead Microsoft Corporation Patterns & Architecture.
VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc (
Be The Master Of Your Domain with POCO WCF RIA Services SILVERLIGHTSHOW.NET WEBINARS SERIES BRIAN NOYES, CHIEF ARCHITECT, IDESIGN INC 27 Sep 2011.
.NET Framework V3.5+ & RESTful web services Mike Taulty Developer & Platform Group Microsoft Ltd
Ronnie Saurenmann Principal Architect Microsoft Switzerland
Peoplesoft: Building and Consuming Web Services
Ronnie Saurenmann Microsoft Switzerland
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
1 INTRO TO BUSINESS COMPONENTS FOR JAVA (BC4J) Matt Fierst Computer Resource Team OracleWorld Session
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Entity Framework Code First End to End
LINQ Boot Camp ADO.Net Entity Framework Presenter : Date : Mahesh Moily Nov 26, 2009.
RIA Services Master Class Presenter: Kevin Grossnicklaus November 30 th, 2010.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Entity Framework, a quickstart Florin−Tudor Cristea, Microsoft Student Partner.
Eric Nelson (or )
Marc Ziss Z Consulting Code Name 'Oryx' Web application scaffolding Easy to dynamically display pages based on the data model of.
Developing Reporting Solutions with SQL Server
ADO.NET DATA SERVICES Mike Taulty Developer & Platform Group Microsoft UK
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
Project “Astoria” first announced in Mix 2007 Shared early prototypes, got tons of feedback Now we’re talking about the real deal Production quality bits,
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
Ronnie Saurenmann Principal Architect Microsoft Switzerland.
VWF310: Encapsulate Custom Business Processes with Custom WF Activities Brian Noyes IDesign Inc (
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Visual Studio 2005 : New Features for the Web Services Developer Malek Kemmou CEO Arrabeta Consulting Microsoft.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Principal Consultant.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
Pete Brown Developer Community Program Manager, Microsoft REST with Silverlight 5, WCF.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Hello WCF RIA Services An introduction to RIA Services Gill Cleeren Microsoft Regional Director Silverlight MVP Ordina Belgium.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
1 ADO.NET Data Services Mike Taulty Developer & Platform Group Microsoft Ltd
Developing with WCF RIA Services Quickly and Effectively Nikhil Kothari Software Architect, Microsoft Corporation Blog:
REST By: Vishwanath Vineet.
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Magenic, Principal Consultant Level: Introductory.
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
By Rami Mounla Optimistic Concurrency Control Copyright 2010 FUJITSU LIMITED.
Data Access Methodologies: When to choose what (ADO.NET, Entity Framework, WCF Data Services) Wriju Ghosh Lead Partner Consultant, Microsoft.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Spaso Lazarević Microsoft MVP Nova banka ad Banja Luka Building business application using Visual Studio 2013 LightSwitch.
KORAK PRED OSTALIMI VISUAL STUDIO LIGHTSWITCH Danijel Malik Artifis Danijel Malik s.p.
2 ADO.NET Data Services for the Web Mike Flasko Program Manager, Microsoft “Project Astoria”
Top 10 Entity Framework Features Every Developer Should Know
Introduction to Entity Framework
Better RESTFul API – Best Practices
Beyond the BDC\BCS Model
Distribution and components
Entity Framework By: Casey Griffin.
Visual Studio 2010 and .NET Framework 4 Training Workshop
ADO.NET Entity Framework
An Introduction to Entity Framework
Windows Communication Foundation RIA: Ready for Business
Accessing Data in a .NET Web Application
Tech Ed North America /1/ :36 AM Required Slide
Visual Studio + SQL Server Is Better
WCF Data Services and Silverlight
.NET Framework V3.5+ & RESTful web services
Presentation transcript:

WCF RIA Services - Querying and Updating Data SILVERLIGHTSHOW.NET WEBINARS SERIES BRIAN NOYES, CHIEF ARCHITECT, IDESIGN INC 2 FEB 2011

WCF RIA Services Overview Simplifies building N-tier Silverlight applications – Some ability to consume the services from other client types Focused on Line of Business (LOB) applications – Highly dependent on pull-push of data from back end Architecture and tools for building the glue code between the client and the back end – Client framework for query/update, validation, security – Server framework for exposing services without needing to know WCF Entities Validation Service Access Services Entities Validation Presentation Data Access WCF RIA Services DB

WCF RIA Services Benefits Greatly reduces the amount of raw plumbing code you have to write Prescriptive architecture for working with data on the client side Hides the complexities of WCF from you Extends the LINQ programming model to N-tier Client side framework for service calls, validation and security

What do you need? Silverlight Tools for Visual Studio 2010 – Core bits RIA Services Toolkit – Other endpoint types (SOAP, JSON) – ASP.NET support for consuming domain service in process Coming: – WCF RIA Services SP1 Beta 1 Complex types support for child objects Sharing entities across domain services Better data binding to client collection types Various other improvements

WCF RIA Services Overview Link client project to server project Define server side domain services – Base classes: DomainService, LinqToEntitiesDomainService Compile WCF RIA Services code generates client side “proxy” code – Domain context – Entities – Validation – Shared code

Entities Can be any type Entity Framework or LINQ to SQL entities supported out of box POCOs must follow certain conventions Must have a [Key] property – i.e. CustomerId Relation properties must have an [Association] attribute to indicate the related property type’s key fields Need [Include] attribute on properties to child entity collections or single entities to have them serialized

Metadata Classes Define a partial class for the entity type Define a nested metadata class inside the entity type – Not required, but convention – “Buddy class” Add a MetadataType attribute on the entity partial class to tie in the metadata type Add attributes to properties on the metadata type that match the entity properties Those attributes show up on the client entity type or influence entity transmission – Validation – Include – Exclude – Composition

Query Operations Read operations – Return object, IEnumerable, IQueryable IQueryable and LINQ provider required for deferred execution – Query attribute on methods - optional IsComposable=false when returning single entity ResultLimit to constrain maximum items returned to client

Loading Data on the Client Allow you to execute a DomainContext method to query data – Including updates Drag/drop data binding is VS 2010 Supports parameterized queries Supports sorting, grouping, filtering, paging Not a good fit with MVVM – Puts query “logic” into the view

Loading Data on Client DomainContext.Load method – Pass an EntityQuery – Can modify the expression tree on client if target method in DomainService returns IQueryable Executes asynchronously Bind to entity collection for automatic update via INotifyCollectionChanged Pass async callback to be notified and work with results or handle errors yourself Can work with returned LoadOperation for async notification as well

IQueryable and Deferred Execution RIA Services serializes the expression tree from the client the server LINQ operations specified by the expression tree are executed on the server When the underlying provider supports it (i.e. Entity Framework and LINQ to SQL), deferred execution goes all the way to the DB

Querying Relations Domain service needs to return related entities – i.e. Customer – Orders – Entity Framework: ObjectContext.Customers.Include(“Orders”) Entity metadata type needs [Include] attribute on related property

Update Operations Entity changes are cached in the client DomainContext until SubmitChanges called – Contains an EntityContainer that tracks changes Sent as a batch to the service – Including original version for optimistic concurrency Service executes batch, calling Insert, Update, and Delete methods with one entity per method call

Update Operations Naming convention in domain service to identify methods – Insert: InsertXXX, AddXXX, CreateXXX – Update: UpdateXXX, ModifyXXX, ChangeXXX – Delete: DeleteXXX, RemoveXXX – Where XXX is an entity type name Attributes exist for explicit declaration of intent – Insert, Update, Delete attributes

RIA Services and MVVM MVVM is all about keeping logic execution out of the view DomainDataSource is specifically geared towards putting query logic in the view in a declarative fashion – Impedance mismatch DomainContext can be used in the view model directly – Problems: Testability, Separation of Concerns DomainContext can be hidden in a service / repository – Lose the flexibility of the programming model from the view model’s perspective – Fair amount of work to abstract the programming model

Summary WCF RIA Services provides an easy to use and powerful mechanism for Silverlight clients to query and update data from a service back end Queries benefit from deferred execution Updates benefit from rich validation mechanisms – Future webinar For more info, see my WCF RIA Services series on The SilverlightShow: Started.aspx Started.aspx Contact info: Blog: