At MIX10, I presented the Developing with WCF RIA Services Quickly and Effectively talk. For the demos I used a BookClub application - the scenario is a team application for team members to use to share books and browse/search/request shared books.
The following are the concepts that the demos and code cover:
- CRUD (editing your shared books) using the domain service pattern in the BookShelfService implementation, along with both convention and configuration.
- Using LINQ across client and server, and working with EntityQuery object on the client, to implement both filtering and "More"-style paging.
- Validation via declarative metadata and imperative rules.
- Reference data pattern for implementing lookup comboboxes.
- Custom DomainServiceFactory implementation for customizing instantiation of domain services in the application.
- Custom authentication service implementation (that authenticates and validates user credentials using a Members table in the data model rather than ASP.NET Membership).
- Custom authorization rules (see CustomAuthorizationAttribute, just like validation)
- ViewModel pattern, aka MVVM, to complement RIA Services, and how you can design view models starting from your user interface or a sketch of a prototype.
- Taking DomainServices to the next level by using presentation model or projected types (see how BookClubDomainService exposes BookInfo entities that is a projection over multiple tables in the underlying data model).
- Aggregating data from multiple sources (database and Amazon service) within a single DomainService.
- Invoking and using stored procedures within a DomainService.
- Implementing Invoke operations, i.e. non-CRUD operations alongside the CRUD pattern (see the RequestBook operation on BookClubService).
- Reusing the domain service across different front-end applications and screens. Specifically I had a Windows Phone 7 application that used a regular SOAP interface to the same domain service to access the BookClubService.
I tried to approach this sample with an eye toward how a real-world application might be built when using RIA Services, based on my blog post before the talk and some of the comments that were posted. I realized there was way more than enough content, but decided to keep the sample as-is for the purposes of sharing it out.
I’ll be blogging many of these bullets listed above with more details in subsequent individual posts, so stay tuned. However, for now you can browse through the code, and the slide deck to get some sense of the concepts. Note that you’ll need to create the database using the included SQL script, and specify your very own Amazon ID and secret key in web.config to run the samples.
I’m on twitter (@nikhilk) if you’d like to connect and be part of the conversation. As always, comments, as well as questions, are welcome below.
Posted on Sunday, 3/21/2010 @ 10:51 PM
| #
Silverlight