Koen about .Net

February 22, 2010

Reply to ‘The State of Data Access in Silverlight’

Filed under: Development — Tags: , — koenwillemse @ 11:28

Shawn Wildermuth wrote an interesting post about the state of Data Access in Silverlight. As I’m currently working on a Silverlight application which can serve as a reference architecture for applications using RIA Services, I think I can say something about that.

The ‘Add Service Reference’ kind of functionality which he points out could be very interesting, especially when working on large projects. The more projects there are in your solution, the longer it takes to compile, so this could potentianally improve the speed of development. I think it might be interesting in scenario’s where you have a simple model which doesn’t expose much functionality or information, other than what that client needs, but when working on a bit more complex applications, I wouldn’t want to expose my domain model outside the services.

The points he makes about Validation attributes, eager loading and navigation are not really points that are interesting for me (now). Reason is that I don’t want to expose my domain model using RIA services. As I look at it now, it exposes a lot more information than needed. So I use Dto objects to transfer information to the client with the simple validations which can be done using the attributes.

The point he makes about the loosely coupled application when developing with RIA services is true. There are some difficulties to overcome when working with it. It is especially difficult when you want to do development in a TDD way. For instance, to work with a MVVM pattern and RIA services for instance, in a TDD fashion, you will need to create an interface for the generated context so you can intercept calls to the framework. I will write about this in a future post.

So, wrapping it up, adding a ‘Add Service Reference’ kind of solution would be very interesting. Next to that, it would be a good thing if the generated code would be more TDD and mocking friendly. Right now it’s very difficult, because a lot of classes are sealed, or only have internal constructors (like the LoadOperation for instance). This results in the need to define some other ways to work around this.

EDIT: Right after writing this post, I found this blog post from Brad Adams about splitting the project in different solutions. Seems a reasonable work around.

Blog at WordPress.com.

%d bloggers like this: