Is WCF RIA Services ready for the Enterprise?

Today Microsoft released the WCF RIA Services Beta, it’s now on top of WCF and by default uses binary data end points and data contract serialization. By using binary data end points we will get better performance and make the data sent over the wire smaller (The other preview versions uses pure JSON). WCF RIA Services is a great framework for Rapid Application Development (RAD) of 2-tier applications. Based on the new changes to the WCF RIA Services it’s defiantly ready for the Intranet and small applications, but how about the Enterprise. First of all if you uses the Entity Framework or Linq to SQL Domain Services, it’s not ready for the Enterprise and will never be, IMO, because when we use it it distribute DAL types to the client. They are useful for small data driven applications. BUT! WCF RIA Services with the DTO (Data Transfer Object) support will make it closer to be ready for the Enterprise, but is that enough?

It’s complex to build RIA (Rich Internet Application) and require a lot of plumbing. This is something WCF RIA Services is trying to solve. Just remember there is a reason why things are complex, and what every framework developers are trying to do, is to hide the complexity by adding a new level of abstraction. The thing is, the complexity is still there. At first I was skeptic about WCF RIA Services, but it was because the very early previous wasn’t that good, it was ok, good ideas but works had to be done. Now after almost 2 years it starts to look like something promising.

I have notice several of developers using .WCF RIA Services and because it’s so easy to use, they seems to forgot about the network. What the WCF RIA Services Team have struggle with, is to make sure developers should be aware of the network. I know that even how much they try, some developers will use it in a wrong way. That is nothing they can do anything about. But is that so bad? NO! It gives the people that use it in the right way job opportunists ;)

I wrote that WCF RIA Services with its DTO support will make it closer to be ready for the Enterprise and the uses of EF and L2S Domain Services are not a good choose when it comes to build Enterprise RIA. There are actually one advantage of using the EF and L2S DomainServices, and that is the way of passing a query from the client to the server. The query will be used when EF and L2S are querying the database (as far as I know, I hope it does at least ;)). It will results in less data sent from the data source. When using DTO the query will take place after we retrieve all the data from our DomainService query methods. But still on the server. But the good thing is that there is a solution to make sure the query also takes place when we query our data source and that is by overriding the DomainService Query method, it has the description of the query passed from the Client. But we had to interpret it and transform it to a query which can query our domain model.

It looks like developers loves the data annotations added to WCF RIA Services. The validation part is great when it comes to the uses of EF and L2S Domain Services, because the DAL types are generated from the tools (hmm, thinking of the Devils is in the tools ;)), and it’s “hard” to add validation to it. In that case with WCF RIA Services we can use annotation to add validations, which will be available both on the client and the server. Isn’t that great? DTO also support validations buy adding annotations. You have to have in mind, that this validation can’t be tested with Unit Test, it’s the Framework which will execute it. But you also have to remember that DTO is just what is says an object which transfers data. On the client-side we may use a ViewModel which will handle the validation instead.

Back to the main question, is WCF RIA Services ready for the Enterprise? If I say Yes, it may be a lie, if I say No, it’s definitely a lie. I think it’s ready, or at least I would give it a try. I think the team have made a great framework, I will with no doubt recommand it to others.


  • I am not sure I agree with your assertion that the Entity Framework or Linq to SQL Domain Services will never be enterprise ready. I think the new Presentation Model capabilities of WCF RIA Services go a long way to fixing to changing that.

  • @Colin Blair:
    The EF and L2S Domain Service will more or less only distribute DATA objects, the WCF RIA DomainService is the Service layer of an application and shouldn't contain any business logic (to make sure we do a separation of concerns) and shouldn't distribute domain entities, instead DTO or a "presentation model" (refer to a model designed for presentation purpose). Remember the Service layer is not the layer that should perform business logic, it's a layer top of the "business logic layer" (my window to my logic). What I don't like is the name DomainService, because it's a name used in DDD. A Domain Service provides functionality that does not sit comfortably on a single Entity or Value Object.

  • I agree with not passing domain entities down the wire. However, since passing DTO's/ViewModels down the wire is possible, and provides the communication, proxies, client-side unit of work, etc... that this is really a matter of how you design the application.

    ie. In Brad Abrams series he was passing the entities all around, all the demo's show that being done... when I emailed him, he created a sample using a mapping to a DTO that was send down the wire.

    So I do agree to your statements, but I will add this isn't about 'RIA.NET' - it's about proper design and architecture of an enterprise app that would use DTO/ViewModels

  • @Fredrik N That is pretty much my point, the new WCF RIA Services does have Presentation Model support so that the EF and L2S DomainServices can send DTO/PM objects to the client instead of the entities themselves.

  • @Colin Blair:
    Absolutely, but what I'm talking about is the EF and L2S Domain Service, where it's used to send DAL types.

  • Do you have some tests done? Can we see some graphs?

    I found it interesting that it is still not yet Enterprise ready, but maybe on Visual Studio 2010 launch we'll gave it good for production stage. It evolved too fast to be just left in this state.

  • @Radu Poenaru:
    "I think it’s ready, or at least I would give it a try."

Comments have been disabled for this content.