Mastering WCF RIA Services

clock November 19, 2009 16:10 by author jamesstill

You don't have to use EF with RIA Services. Dinesh Kulkarni demonstrated how to implement a DomainService class using NHibernate.

Kulkarni emphasizes that WCF RIA Services is a prescriptive pattern and that they designed it to be DAL agnostic. Sounds like the Ruby philosophy...

For your DomainService implementation you can add an attribute for an update method to declaritively require that the user be in a certain role:

[RequiresAuthentication]
[RequiresRole("Administrator")]
public void UpdateFoo(SomeEntity entity) {
   
}

This is useful if you want end users to be able to query data without yet logging in but then they have to log in to makes updates.

Best practices to use RIA Services effectively:
 
Do:

* require authentication / roles
* use https in IIS
* utilize query composition (filter, sort, page)
* consider custom update
* factor into multiple DomainService classes and libraries, especially for large apps
* handle errors server-side
* use declarative validation

Don't:

* deploy with anonymous access
* expose non-essential entities/operations
* allow free-form access to data (malicious user problem)
* don't throw everything into one big DomainService class

Unfortunately we ran out of time and he was unable to demonstrate the NHibernate plumbing.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Brad Abrams on RIA Services with EF

clock November 19, 2009 06:26 by author jamesstill

Abrams basically walked through a typical RIA Services app and most of it is familiar to anyone who has studied the RIA Services documentation and walkthrough. However there were several new things specific to VS2010 and the new bits.

RIA Services is now built on top of WCF. Yep, it's a first-class citizen on the stack right next to Workflow Services and Data Services. Brad Abrams said his goal with RIA was to force n-tier dev and to get people into the 21st century. :) That's why (and I'm translating here, he didn't say this) RIA is a prescriptive framework following the 80/20 rule rather than something totally open ended like the vanilla ASP.NET web project template.

The project template is now out of the box in VS2010/.NET 4.0. Also, there's a design view for XAML now. In fact, all the SL controls are on the toolbox and you don't have to edit the XAML at all. My first impulse is one of repulsion -- however, I realize that this is a great time saver for doing a first cut on layout and wiring up controls. You can always go into the XAML and tweak it later.

with a DataGrid and Pager control RIA does not go grab all nn number of rows from the database and bind it to the grid like in early ASP.NET. It takes advantage of LINQ and gets only the rows for the current page. That data is cached locally so if user clicks back arrow to go back to page 1 it's there.

No more XAML exploring. VS2010 has a Document Outline toolbar that shows a visual representation
of the nodes and their hierarchy.

No more rebuilding the RIA Service in order to push the gs file down to the SL client. Changes are reflected right away.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About

SquareWidget LLC is an Oregon-based software development company that specializes in handcrafted .NET software solutions.

Search

Archive

Categories


Sign in