RIA Services at MIX10

A bit about my RIA Services talk at MIX10... let me know what you'd like to see.

My MIX10 talk was published a little while back - as you might expect, its on RIA Services:

MIX10 Art

Developing with WCF RIA Services Quickly and Effectively

WCF RIA Services provides an end-to-end framework for creating n-tier, data-driven applications on top of Silverlight, ASP.NET and WCF. This talk demonstrates how you can use the framework and tools to get started quickly while focusing on your business logic rather than on plumbing and infrastructure. This talk goes beyond the basics to demonstrate how you can use RIA Services effectively to create well-architected solutions that employ best practices, advanced techniques and integrate key application patterns such as ViewModel (aka MVVM) that enable you to scale your solution on the server and across presentation and data technologies, and to create great user experiences on the client.


What would you like to see covered? If you have any thoughts, please share. If it fits with the general flow and time, I'll try to include it. Or it might make for seeding the Q&A...

I'm planning to skip the drag/drop style demo. I think folks have seen that, and get it that RIA Services jumpstarts your application. What do you think? Or is it useful doing a quick introduction? For most of the talk, I am planning to pick a few key patterns and best practices that I believe are indespensible when building real-world n-tier applications, and using the technology effectively. ViewModel (aka MVVM), as mentioned, is one of those patterns, but it isn't the only one. I'm going to pick between 3 and 5 such patterns to fit into the session.

One thing I really love about RIA Services is how it brings together different technologies making up the broader Web platform. Hopefully some prototyping I am currently doing will materialize into a nice exciting demo... fingers crossed.

T-28 days... see you at MIX!

Posted on Monday, 2/15/2010 @ 10:06 AM | #Silverlight


Comments

38 comments have been posted.

Mark Richards

Posted on 2/15/2010 @ 10:18 AM
My problem with RIA and EF is that it seems to work great if your UI is 1 to 1 with your database, but often times my applications and databases are more complex, and will often times pull data from multiple locations for each "screen", and sometimes update data to multiple places. Seeing how to do that would be very helpful to convince me to go down the RIA road.

Ian Smith

Posted on 2/15/2010 @ 10:26 AM
I'd really like some clarification on what the SIlverlight 3 and WCF RIA Services support story is. (We're developing an app where user is using Silverlight 3 and have told us they won't upgrade to Silverlight 4). In Scott Gu's web Q&A session last week someone asked whether "Silverlight 3 and WCF RIA Services" would be supported but Scott seemed to skirt around the question by focussing on Visual Studio 2010 support rather than answering the question directly. The statement that set alarm bells off was "The WCF RIA technologies will require Silverlight 4." We had never heard this stated before.

Scott's answer in full was this: "Silverlight 3 will definitely be included in the Visual Studio 2010 release. As soon as Silverlight 4 ships it will also be supported in the Visual Studio 2010 release. Visual Studio 2010 will also support the WCF RIA technologies that will ship as part of Silverlight 4. The WCF RIA technologies will require Silverlight 4. It uses some of the new data binding capabilities of Silverlight 4 that it requires on the proxy generation. We expect very quickly after Silverlight 4 ships we’ll turn on the auto-upgrade flag so we expect most users to be on Silverlight 4 within about 4 weeks of the point we ship. So to answer the question you will be able to use Silverlight 3 and a combination of Silverlight 4 and WCF RIA Services with Visual Studio 2010 as well"

Now obviously we have a "Go Live" license for WCF RIA Services with Silverlight 3 today, but can you clarify what that means with regard to Silverlight 3 and a final RTM release. It's unclear at the moment whether an RTM release will be supported with Silverlight 3, or whether the insistence that Silverlight 4 be used is just a Visual Studio 2010 tooling issues.

Thanks.
Ian Smith,
London, UK

Corrado Cavalli

Posted on 2/15/2010 @ 10:58 AM
Please skip any drag-drop demo, no one build a serious app using D&D...

Tim Cochran

Posted on 2/15/2010 @ 11:23 AM
I would like to see something around the [Invoke] functionality. What you can and can't do with Invoke to add additional functionality (non-CRUD) to your DomainService class. When it is proper to add functionality to DomainService (via [Invoke]) versus developing a separate WCF Service to handle additional functionality (non-CRUD).

Ben Hayat

Posted on 2/15/2010 @ 11:43 AM
One thing that I see gets missed or ignored, is not just developing the app, but deployment issues that we need to follow to have a successful deployment. But these steps shouldn't only be for the developer who built the app, but others could take a SL app developed using RIA and deploy it on a Shared or Virtual hosting.
* The requirements to host a RIA app.
* What platforms will it run on.
* What steps needed to take to install a RIA app outside of VS development.

Customers want to know how they can purchase a SL app and then install it themselves. This is something is needs to become very clear!

anil

Posted on 2/15/2010 @ 1:56 PM
Trying to cram too many things into limited presentation time could be a challenge. Silverlight and RIA technologies already had their share of "wow" factors and above par reactions from the viewers in the past.
You have been very active on many forums and adviced people on many things. Thank you! I am hoping your presentation covers the pressing issues that developers are facing in implementing RIA services.
Not that this is your main topic, but if I were you , I would shy away from anything related to domaindatasource, out-of-browser, drag-drop magic and all that jazz! Waste of time.

Like some of the people posted above, I would like to see something more realistic than slapping an EF/Linq model on a well designed database. In reality, databases are cacooned by DBAs who think "stored procedure" is the only magic word to get to them. So be it. But if your presentation could help us understand RIA implementation covering POCOs, DomainService, Inheritence, Persistence, Parent/Child objects, Error Handling over the wire etc., that would be awesome. MVVM concept explained over a page showing multiple user controls could be gravy too!! 1:1 MVVM is just a "hello world" IMO.

Thanks
Anil

Ivan Perez

Posted on 2/15/2010 @ 2:18 PM
I'd like to see some info on the serialization/deserialization story for RIA services, in particular when you have and require the inheritance stack to be preserved. In the case that I'm worried about are collections of some base type that can have many different concrete implementations. And that the serialization doesn't flatten the objects any more.

I'd also like to see more info about security/permissions on certain calls.

Billy Porter

Posted on 2/15/2010 @ 4:09 PM
I'd love to see how to use it together with the UI components without using the DomainDataSource - that is: doing it all by code. I ran into some problems doing this.
And for crying out loud: no drag n' drop - this is not us trying to be fancy - we all KNOW anything but 100% code control is a waste of time in any real world app.

Like many others, I was totally dumbstruck when I saw that the DomainDataSource had been added to Silverligth. Decalarative data sources are just horrible to program against.

Thanks!

Michael Iantosca

Posted on 2/15/2010 @ 9:52 PM
I really want to learn about how to implement MVVM along with RIA services - I have implemented MVVM in a few SL 3 apps and would really like some guidance on how to use the same design pattern with RIA services. No drag and drop please!

Thanigainathan

Posted on 2/15/2010 @ 11:29 PM
Hi,

Very nice post.

Thanks,
Thani

Mahesh

Posted on 2/16/2010 @ 3:00 AM
Thanks for inviting such suggestions.

In my opinion, your presentation should include -

1. Creating WCF RIA Services with best/recommended configuration for each scenario. like since it is WCF, when to use TCP binding or when to use HTTP binding, security implications, etc.
2. Best/recommended format (XML or JSON) to expose data via WCF RIA services.
3. Use of DomainDataSource in XAML using MVVM pattern.
4. Use of Printing/reporting.
5. Testability example for Model, View and ViewModel.
6. and most forgotten in all demos, how to deploy whole application in real life production environemnt with correct security setup. This should also cover moving application from Dev to UAT and then to Production setup.

All the best !!

Mahesh.

Um

Posted on 2/16/2010 @ 2:13 PM
Um, Corrado Cavalli, what are you smoking? Your subjective opinion is more than inaccurate, it's absurd!

An oft anemic topic, Logging!! To File and DB logging to be precise.

Asheesh Soni

Posted on 2/16/2010 @ 3:37 PM
No drag n drop or wow this is magic!
Real word example of using MVVM with WCF Ria Services.
Not just single table demos. Work on projections from multiple tables.
Not just read only UI. Explain CRUD on multi - table entities.
How to use stored procedures and views that return projections on the entities? How to translate changes back to Insert/Update/Delete statements when working on these projections?
Not just one time building of the app. What happens when the database schema changes? Any way to refresh Domain context etc. to pick up the changes?

One thing I find strange about the domain service is that we start modifying the code that was generated for us. What happened to the partial class concept of separating generated code from hand written code?

Asheesh Soni

Posted on 2/16/2010 @ 3:38 PM
Real world :)

Steve

Posted on 2/16/2010 @ 3:58 PM
All good feedback here.

To add:
Lets assume that we are not going to pass EF or L2S through our services - assume data contracts.

Asheesh Soni

Posted on 2/16/2010 @ 4:05 PM
What happens when I want to add a few more entities to my domain service / context at a later stage (i.e. after I have made changes to the generated domain service).
(This is similar to the situation above where there are changes in the database schema)

Craig

Posted on 2/17/2010 @ 4:03 AM
I'd like to see a demo of a real world Enterprise app.

SL4 as the desktop UI, Webforms as a mobile UI, Custom WCF for SOA with integrated Authentication and a complex Data model, all using the same RIA services to access the backend.

Steve

Posted on 2/17/2010 @ 8:25 AM
Nikhil, maybe way outside of scope, but I'd love to see Prism with RIA accessing WSSF created services with data contracts.

That to me would be 'enterprise'.

GEB

Posted on 2/17/2010 @ 8:50 AM
I'd like to see a discussion of how to best use GROUPBY /DISTINCTcapabilities of RIA Servcies / EF on the server-side.

Nikhil Kothari

Posted on 2/17/2010 @ 4:48 PM
This is great feedback. Thanks all. Feel free to chime in with more...

So to set some expectations, this is probably an hour long session that needs to set something up, demonstrate something, and then wrap up along with some conceptual overview. So to be realistic, the examples will have some element of demo, but my goal is to present concepts that can be translated into real-world apps.

Specifically, its loud and clear to avoid drag/drop. Good to hear the confirmation. Even better, a number of things showed up that I do hope to cover in some shape or form. Examples include pulling data from multiple locations/tables, POCO types, error handling, MVVM, use of [Invoke]. I'll try to throw in a stored proc in there too.

Need to think of an interesting app scenario I can use to tie together the concepts.



@Ian Smith
The story is for the final RTM version to be based on Silverlight 4 and Dev10. Doing so lets us use key platform capabilities to implement the desired validation model, support for partial trust etc. The 3.5 version can be used if you are using, but won't be revised going forward.

@Ivan Perez
Serialization will flatten types when you don't expose parent types from a domain service. For example, if a service only exposes types A and D, but not B and C that are intermediate classes, then B and C will be flattened into D.

@Billy Porter
I think data sources and declarative components have their place. Basically my philosophy is use the right tool for the job at hand. In the future I'll blog some more on this area.

@Mahesh
For the browser/RIA scenario, the general model is to build on top of HTTP for the majority of scenarios. And with RIA Services, we hope app developers get to focus on the app, rather than protocol and serialization - more specifically, the infrastructure tries to pick the optimal implementation by default.

Testability - I might not get to show it with full justice, but I've blogged about it in the past.

@Asheesh
The code generated by you for a DomainService is starter code from a wizard. Its meant for you to edit and add your unique application/business logic. Its not meant to be generated code that shouldn't be modified.

@Steve
For the scope of this demo, I don't think I will get to compositional apps, Prism and the like. I agree, super important, but there are a number of concepts to get through that you'd use within the context of a single component, and then compose along with others.

NL

Posted on 2/17/2010 @ 6:31 PM
Hi Nikhil,

As part of your real world app, could you demo the recommended way to do file/image uploading? I've seen various WCF RIA Services examples around a byte[] but couple of things with this is that large files don't work well and as far as I can tell there is no way to get file upload progress. As a result, it seems the right way to handle large file uploads is via a WCF or asp.net web service. My question then is how to secure the (web service based) upload operation after authenticating against WCF RIA services.

Finally, can you show the round trip for a scenario like this... In essence, if the backend is part WCF RIA and part regular web service, what is the unification story and how do we as an example:
1. Log the user in (WCF RIA)
2. Allow user to create a photo-album (WCF RIA create entity)
3. Upload multiple images (regular web service) and store them at some url (file directory, azure storage blob, etc.)
4. Tie the user's uploaded images to the user's photo album?

For step 4, is the approach to have some back-end process with some user id and photo album id (passed with the file upload) to make a call into the WCF RIA services to add the image urls into the user's photo album?

Thanks.

Asheesh Soni

Posted on 2/19/2010 @ 1:54 AM
Hi Nikhil

Thanks for your clarification. I now understand that the Domain Service Wizard simply provides a starting point.

What I am looking for in the demo is a combination of the following 3 MSDN links in a real world app:

1. http://msdn.microsoft.com/en-us/library/ee796239(VS.91).aspx (Displaying Data in a SL Business App)
2. http://msdn.microsoft.com/en-us/library/ee707338(VS.91).aspx (Editing Data From a Domain Service)
3. http://msdn.microsoft.com/en-us/library/ee707347(VS.91).aspx (Presentation Models)

The 1st link is based only on a Single Employee Table.
The 2nd link again explains editing with a single table.
The 3rd link is exactly the stuff I want to do... Presentation Model which has objects from multiple tables.

It would be great if you can go through the stuff in link 1 & 2, but based on link 3.

The 3rd link (Presentation Models) talks about creating PM objects by hand (POCO). When I looked at Entity Framework 1 or 2 years ago, I was hoping it'd be a nice GUI based way to create and maintain my "Presentation Model". But I have run into a lot of issues with EF when used in real world apps (like use of multiple databases, views, stored procedures etc.) I hope your demo will show us the right way to use EF + RIA Services + MVVM in a real world app covering various scenarios and an example of how to maintain the application when the underlying database schema changes (eg. Changes in an entity etc.)

Thanks

Nikhil Kothari

Posted on 2/19/2010 @ 7:33 AM
@Asheesh
I personally think presentation models are types you define/implement, and so I wouldn't look to a UI designer way of doing it. There really is no magic - you have to map to/from DAL types.

As for changes in schema, yes, everyone dreams of somehow things auto-updating when schema changes, and that indeed would be wonderful, until you realize that what you're talking about is changing arbitrary app code, view markup that developers and designers have written... quite nearly impossible. Even if every developer wrote code the same way, it would be a challenge, since every app is after all different. The only way to really tackle that is reduce amount of code app developers write, i.e. more of modeling your app, and more code-generation based on that model.

Lino Tadros

Posted on 2/23/2010 @ 7:51 PM
Hi Nikhil, hope all is well. Great work!

http://blog.falafel.com/2010/02/24/RIAAndEntityFrameworkBasicRequirements.aspx
I am hoping you can take a look at this blog post and point us in any direction of how to solve this problem. It seems very simple and hopefully SL and RIA has this built in somewhere.

Hope to see you again soon
Lino Tadros, MVP
Falafel Software Inc.

Nikhil Kothari

Posted on 2/24/2010 @ 12:01 PM
@Lino
I believe we should be able to address your scenario of associated entities, lookup dropdowns and reference data. I definitely want to cover this during my MIX talk. I'll see if I can create a simple sample, and blog about it before then...

Lino Tadros

Posted on 2/24/2010 @ 12:21 PM
Thanks a million Nikhil,

I really appreciate your feedback on this. I know how busy you are before MIX but if you can find the time to shed some light with a sample or even some pointers we can take it from there.

Thanks again for everything
Lino

Goldy

Posted on 2/26/2010 @ 6:30 AM
Hi Nik
I would like to see more control on the generated code that happens under the hood. My Big pain here is Timeout Errors that are caused. I assume that default timeout is set to 60 secs, where can I go and increase it. Do we have any option of it.
Moreover there is no configuration generated neither on the server side or the client side which normally happens when you create a new WCF service and add its reference to some client app.

You need to give more control to the developers to make this work.

thanks

Nikhil Kothari

Posted on 2/26/2010 @ 10:41 AM
@Goldy -
With the final v1 build you'll be able to change the default timeout on the client by getting hold of the underlying WCF ChannelFactory from the WebDomainClient.

Marc Schluper

Posted on 2/26/2010 @ 2:35 PM
Without knowing how WCF RIA Services can be used (on the intranet) with impersonation to access a SQL Server database, it's far too risky to start building applications with it because impersonation is a requirement for deployment. It's company policy to have all apps use the user's windows credentials to access the database.

Nikhil Kothari

Posted on 2/27/2010 @ 12:25 AM
@Marc
Your comment doesn't say whether you tried it or not. Perhaps you can try:
1. Set your authentication mode to windows (standard asp.net config ... <authentication> section)
2. Mark your DomainService with [RequiresAuthentication]
3. Turn on impersonation (again, standard asp.net config ... <impersonation> section)

If that doesn't work, then I suggest you report the bug asap. You have to remember RIA Services builds on top of ASP.NET and WCF, and so existing techniques don't get thrown out the door. They still apply.

Taiwo Ojo

Posted on 2/28/2010 @ 11:50 PM
Thanks Nikhil for great job you have been doing.I want you guys to talk about event hook up to our MVVM such as checkbox event,radiobutton event and so on especially when using MVVM.Also,i want to see how we can validate our data when using MVVM,WCF and DTO together in buliding n-tier application.Most of the talks i have seen so far just talked about RIA services which can easily be validated by merely using metadata.Please i will like to hear your opinion about it.Thanks.

Werner

Posted on 3/1/2010 @ 12:45 AM
Hi Nikhil.

I hope it’s not too late.

I would really like to hear about concurrency and RIA between different clients. This is something that no-one has mentioned and I haven't seen anything said on the topic anywhere? Maybe persistency came close.

Is there some sort of a multicast push technology that can be brought into WCF Services that auto magically updates all the clients with the latest database information. I am heavily involved with LOB applications where I believe this kind of problem is more prevalent.

If the topic was covered somewhere, I apologize. So busy just getting the basics together... MVVM/PRISM working with MEF/Logging/RIA/EF... it gets a bit much sometimes.

Werner

Nikhil Kothari

Posted on 3/1/2010 @ 2:01 AM
@Werner
Thanks for the suggestions - just to be clear we're talking about an hour long session, and that means about 1/2 hr (and even that might be pushing it) for a relatively more advanced demo. :-)

So I won't be covering Prism/MEF or any specific MVVM framework, or composition, even though I think composition is super interesting and useful. There is just not enough time.

However, all the suggestions certainly do a couple of things: provide an indication of what the community thinks is important, and that goes into the product over time, and secondly, fodder for future blog posts, etc. So if you have ideas for helping drive that, do keep posting them! I am toying with a couple of ideas around a reference app - maybe it will pan out and I can show more in the context of that.

Werner

Posted on 3/1/2010 @ 2:45 AM
Yea one hour is not enough.

Blogging about it would probably be a better platform to address such things directly, but your talks do help.

But, I listened to you one year ago at Tech Ed 09 in Durban South Africa and you covered fairly advanced things. I remember you ended up showing some dependency injection with your twitter bug etc. Back then I was clueless, but now those things seem trivial. So what I am trying to say that putting in a little extra advance stuff in a seminar does sometimes reach people.

Looking forward to more blog posts ;)

W

John Waters

Posted on 3/14/2010 @ 8:01 AM
Nikhil, see this discussion off my original post that you referended above:
http://jeffhandley.com/archive/2010/03/12/lookupdata.aspx
Some interesting perspectives there for sure.
Thanks
John

Vee

Posted on 3/21/2010 @ 4:23 AM
Hi Nikhil,
Will you be able to share MIX10 demo code. It was great demo.

Thanks
Vee

Nikhil Kothari

Posted on 3/22/2010 @ 1:59 PM
@Vee
Thanks. Slides + demos shared at http://www.nikhilk.net/RIA-Services-MIX10-Slides-Code.aspx ...

David Hu

Posted on 8/15/2010 @ 5:36 PM
Hi Nikhil,
There is an important issue between RIA and Prism, as I can see
that RIA provide a very efficient WCF communication between server and client while
Prism provide a robust way to modulize larger apps.
I really prefer using RIA template with authentication, and of course MVVM is the right pattern to include in too.
Well, I try to combine these elements together and believe lots of developers would like to do that too.
This is a dreamed solution, i've heard the P&P is working on, not 100% sure about this.
Well any advice or any light in the near future is very much appreciated.
Your fan
D
Post your comment and continue the discussion.