.NET RIA Services Twitter Pitch

It was bound to happen - can you describe .NET RIA Services in a single tweet? Heres a twitter conversation, and then a followup with a few more details...

There is the well-known elevator pitch - can you describe something while riding in an elevator? Now we have the twitter pitch - what can you describe in 140 characters?

Here was a question on twitter from yesterday:

Can someone explain in 140 characters or less what .Net RIA Services is?

And Brad tweeted his response:

@hotgazpacho How is this: .NET RIA Services makes writing n-tier silverlight apps much easier! @nikhilk do you want to take a shot?

So I did, with my tweet:

@hotgazpacho #RIAServices simplifies RIA & Web app development by prescribing patterns for writing app logic & providing out-of-box app svcs

Now if I had a little more time, in the case of an elevator pitch, say we got out on the same floor and were continuing to walk in the same direction, I might add the following:

A key value proposition is the ability to think of your RIA as a logical extension of your server, i.e. its part of the same application, a rich projection to some extent, rather than a separate applications. Based on that perspective, .NET RIA Services prescribes a pattern, centered around a class called DomainSevice, that allows you to work with data, esp. in an n-tier context, in an end-to-end manner (quering, editing, creating units-of-work, validation, conflict handling, offlineability etc), by structuring the queries and operations you want to expose, and describing the semantics and intent with things like validation, and authorization rules as well as visualization hints metadata and shared code. Additionally you also get to benefit from out-of-box higher level application services like authentication, authorization, user settings, and with more to come in the future.

OK, so now you’re interested (hopefully), and might wonder more about what is this DomainService thing that I alluded to. You might ask me to do an email writeup (someone actually did exactly that yesterday). Here is a bit of what I wrote in my reply:

An app developer authors a DomainService to encapsulate their application/business-logic (validation, authorization and rules, triggering workflows etc) by implementing a logical group of CRUD and custom operations that together define a particular function of their application (eg. a catalog, purchase order system etc). A DomainService exposes this functionality to one or more presentation layers (eg. Silverlight, ASP.NET, Ajax etc.) or to a service tier (eg. WCF, ADO.NET Data Services), and in turn encapsulates an underlying DAL or data model. It also exposes a presentation model by virtue of the operations it defines. This presentation model might include portions of the underlying data model, but is primarily a separately designed model suitable for use by the presentation tier. Most DomainService implementations will not just be an indirection and pass-through layer to the DAL they encapsulate - instead, they will contain a bunch of meaningful code that is unique to the application.

We had some key requirements and constraints when coming up with the pattern and the DomainService infrastructure:

  • DAL agnostic - we don’t want to create yet another DAL. More importantly we want to allow developers to leverage their DAL of choice and its specific capabilities, whether its direct db access using something like ADO.NET, Linq To SQL or EF, or indirect through repositories or services. You might not even work against a database in a classic sense. You might be working against a workflow, or any source for data in the truly general sense (eg. Active Directory, the current process list, etc. etc.)
  • DAL encapsulating - the next tier consuming the DomainService shouldn’t need to know about the particular DAL choice, thereby enabling the developer can completely switch DALs at a later date.
  • Reusable - the application logic you write within a domain service is a key asset you’ve invested in. It needs to be reusable in different contexts and different presentation requirements you might have.
  • Testability - given a DomainService is an interesting asset, one should be able to independently unit test the domain service by mocking out the DAL and its other dependencies. From a separation of concerns perspective, it encapsulates the app logic, and doesn’t take on things like persistence, serialization etc.

And finally, if you really want to look deeper into the architecture with some pictures, I’d point you at my blog post on the high level vision and architecture of .NET RIA Services. Along with that are links to Brad’s blog, where he has been cranking out samples, and the official bits+doc download. Note: do check out the doc, which was the result of joint effort of folks on the product team.

Posted on Thursday, 7/23/2009 @ 11:00 AM | #Silverlight


Comments

4 comments have been posted.

Colin

Posted on 7/24/2009 @ 2:08 AM
Would you recommend using RIA for a client side only Silverlight app? (i.e. no server interation, just client-side POCO) I haven't found any examples of this, maybe it is overkill?

Nikhil Kothari

Posted on 7/24/2009 @ 9:44 AM
@Colin
You can certainly use the client-side programming model that comes with RIA Services independent of the server. Most of the client pieces don't really know anything about the server intentionally. The only piece that really does know about the server is the underlying transport/proxy layer...

My list of samples to demonstrate these sort of things keeps growing... really need to flesh them out and post them!

Sajin

Posted on 7/27/2009 @ 9:52 PM
@Nikhil,
I tend to like Brad's tweet... it is simple to digest in 140 chars (or in an elevator). Evokes interest, easily digests.
You've packed in so much info in 140 chars that it throws a memory overrun exception in my brain ;)

For a blog post, thanks a lot for sharing those concise paras. It really helped.

Nikhil Kothari

Posted on 7/27/2009 @ 11:59 PM
@Sajin
Good feedback - its interesting to see how one speaks/write to what they might expect to hear/read from others. An adhoc, but very interesting little experiment indeed...
Post your comment and continue the discussion.