The State of Data Access in Silverlight

SilverlightI've said much about my opinion of Silverlight data access. Currently this is Web Services, WCF Data Services and WCF RIA Services. Let's talk about Data Services and RIA Services and how they are related:

WCF Data Services

Data Services are a good story in Silverlight, but only as of version 2.0 of the protocol. For those users of version 1.0, using Data Services was painful as automatic tracking did not exist yet. Data Services can create not only the data contract classes, but a context object that will do tracking and batching for you.  The basic story of how Data Services works is that it takes a context object from a LINQ provider and exposes all the IQueryable endpoints as REST resources that can be queried. This works well in creating a place to execute queries and post/put/delete changes. While Data Services' URI API is another skill that could be learned, the Silverlight (and .NET) client library allows you to just issue LINQ queries to the data service.  In addition, the ability to create client-designed graphs (e.g. embed relationships for eager loading) and navigate relationships to the server presents a good API for a data-centric application today.

The method for connecting to a data service is via a "Add Service Reference..." which means that it is easy to have data services projects that are outside a particular solution file. This is critical for when you are building very large projects.

One of my favorite things about Data Services today is the ability to create tracked projections from the Silverlight client:

var qry = from g in ctx.Games
          where g.ReleaseDate <= cutoffDate
          orderby g.ReleaseDate
          select new 
         {
           Name = g.Name,
           Id = g.Id,
           ReleaseDate = g.ReleaseDate
         };

This projection (which minimizes the data being sent over the wire from a Games entity), can be tracked like any other entity. This is a big boon for Silverlight clients where we want to reduce the surface area of the data being sent over the wire.

WCF Data Services' standard wire protocol is OData (which is a variant of ATOM). This means that tools like PivotTable, code-name Dallas and others can co-mingle data with other systems that are supporting OData like SharePoint, WebSphere, OpenGovernment project and SQL Azure table storage.

Some of the problems with Data Services include the fact that Service Operations are not part of the Silverlight proxy (and are not completely supported by the client library); any validation attributes of model information (like string length) are left on the client; and having to wrap your collections as DataServiceCollections to support tracking.

While I think Data Services still represents a major case for Silverlight usage, it still has a way to go before I am completely satisfied.

WCF RIA Services

WCF RIA Services takes a different approach to data access the resembles a mix of Data Services and Web Services. In RIA Services a server project is set up to expose data across the wire, but instead of Data Services' approach of exposing queryable end-points, it creates methods on the server which can be executed to retrieve, update, insert and delete data. These methods can be crafted to take specific parameters which takes some of the responsibility for what to query out of the hands of the developer (which may be fine in some cases). RIA Services does take model constraints and validation attributes and generate them in the client, which is a big win.  Also, RIA Services is like Data Services in that you can still do basic sorting, filtering and paging via the service.

The way that RIA Services is wired up to a project (via a Shared Code folder that is generated as the server-side project changes) is sexy, but for large projects the need to keep the RIA Services' project in the same solution (or use a project file hack to get it working) becomes an issue.

RIA Services is really built for the RIA Services' DomainContext to be the center of the application (which you can see when you look at demos utilizing their Data Source object that automatically wires up data as XAML elements). While you can write a loosely coupled application, it takes planning and is not the natural design of the API.

Other issue I have is with the design of the Load API where the attempt is made to hide the asynchronicity of the call.  The problem is that when errors happen on the load operation, it is hard to capture the error (other than letting it be cause as a top-level exception) so that most users will need to provide a callback which is just like having a full asynchronous operation. No better than before but the principle of least surprise isn't followed.

Finally, in comparison with Data Services, RIA Services has a lot of the same features but is missing the ability to do projections, client-defined eager loading and loading properties (e.g. relationships).

What does all this mean?

 So here we sit as Silverlight developers and we are being asked by Microsoft to choose of the three major options for data access. The problem is that none of them are perfect by any stretch of the imagination. I would think that Data Services and RIA Services are both great solutions but they are both missing features the others have.  In some ways the generation of these two projects has caused a lot of confusion as to which is the prescribed method for doing data access in Silverlight. It reminds me of the Entity Framework vs. LINQ to SQL debacle.

But where do we go from here?  I'd like to implore Microsoft to fast-track the work needed to provide parity in these products. That means build the underpinnings of both projects from the same underlying platform. That way the features of each platform could be included in the other. The features do not become the discrimator but instead it is the style of data access.  We want and need the missing features on both platforms:

  • "Add Service Reference..." Linkage to support large development projects.
  • Exposure and code-generation of any EDMX constraints and Validation attributes.
  • Projection and tracked minimizing projection support.
  • Full eager loading and navigation support.
  • Operations and Endpoints have the same level of support in the generated code.
  • Obvious and simple communication APIs to prevent the library from surprising us with error propagation.

...One More Thing

I also have the request that for the next development cycle that we provide secondary methods for communicating validation information than just validation attributes.  Validation attributes cause our server-side POCO classes to be not really POCO (since they have to have a reference to the validation assembly).  As well as most cases require us to use the painful and hacky MetadataClass method of creating a class to *only* hold these attributes. You don't have to get rid of the attributes, just let us feed them to the model in other ways (open the hooks, we'll decide how to communicate it; whether it be a DSL, XML file, database, etc.).

Your Job

As a reader of this blog, I'd like to ask you a favor.  Respond to this blog entry. I want to make sure my frustration with the two data access stacks is not just my annoyance but is causing confusion and pain to you my readers. If you agree, just comment (it can be just saying "I agree") so I can make sure the Data team at Microsoft understands how it impacts Silverlight (and others) development efforts.  Thanks!

 

Comments:

Gravatar

RIA Services and Load
One of the effective ways to simplify async programming models is to hide it behind change notifications. And that is what the Load programming model does. As for handling errors, you can either use a callback like you mention, or actual pass the resulting LoadOperation to an error/progress monitor, thereby simplifying that aspect of async.

RIA Services and Validation and POCO
Very much possible - we don't have it out-of-the-box, but metadata can come from XML, a database, or what have you. If you're writing presentation model types, you don't even need a buddy class. The buddy class is a stopgap for a limitation in the programming language, and itself not representative of the programming model.

That is the case on the server. I'd love to see us get the full power to specify external metadata on the client in Silverlight. Until then the only way to propagate metadata is via attributes/codegen.

RIA Services and Eager Loading
You can do this on the server. The thing you're asking for is doing eager loading from the client. The general model in RIA Services is the server is in control. The client can constrain further based on what the server allows... as the client is outside of the trust boundary.

Its interesting that what I think are the P1 pain points of RIA Services aren't in your list. :-)

Gravatar

I meant to add - I think one of the biggest pain points is lack of support for complex types (which I think applies to both), but its high on the list of things that need to be addressed.

Some of the other things you have listed are also on the list.

Gravatar

Yes, I totally agree with you. It is difficult to choose which way to go and what I might be missing going that way.

Gravatar

Hi Shawn, as I was writing a comment, it became a bit large, so I wrote it as a blog post. You can see it here: http://koenwillemse.wordpress.com/2010/02/22/reply-to-the-state-of-data-access-in-silverlight/

Gravatar

I agree, and actually suggested a more "data centric" approach to SL since the first release. Now that SL 3 is here, I am not complaining, but I can see your point that little direction instead of ambiguous options for the sake of having them is needed. It would indeed be nice if WCF, RIA Services, LINQ, EF, and ADO.NET all had a more unified approach and the same underpinnings as you suggested, but different interfaces to suit REST, RIA, ORM, and state full purposes.

(We actually nixed a big SL project to do it in MVC because of more finite data control. LINQ2SQL->MVC just can't be beat.)

Gravatar

I am frustrated as well Shaw!
The stability and feature list of each of the data "avenues" is crippled.
The other day I found out that WCF RIA was a nice RAD only toy when I got confronted with timeout issues...
I got burnt a year ago trying to implement EF 1 with asp.net over N-tier.
They should at least CLEARLY warn people about the limitations of each technology and post ALWAYS present with real world examples.
Thx.

Gravatar

Totally agree. Your roundup is spot on.

Gravatar

Does this apply to developers that expose only stored procedures via their WCF service using OperationContracts only?

We moved from ASP.Net to Silverlight and kept the premise that no data transaction from the client could take place outside of a stored procedure. This definitely made data access on the client more rigid but allowed us to roll-out rich debugging and error reporting right off the bat.

With the extensibility and dynamic loading of modules offered by Silverlight is it secure enough to allow deep data access to the client? Or is the best method still to do everything via stored procedure?

Ken

Gravatar

Shawn, though I'm not that dedicated on the data access layer, I share your problem because I have been working with client server applications for a long time on a framework layer for all layers of an n-tier application.

Microsoft, has tried to create all the above patterns on the first notion of LINQ to SQL which was a complete failure and it was replaced by Entity Framework which is really great but still can seperate the objects from the actual data access layer which is the context.

2 out of 3 of the above technics explained are basically a typed and easy to generate approach of the entity frameworks or linq to sql layer.

In my personal oppinion, as long as the bussiness object cannot actually exist outside of its context, this design is flawed and is only suitable for educational reasons, like completing quickly and easily a project for a .NET class.

Additionally I've heard that RIA services are awfully slow, hence there have been projects that 3 months of development have been scrapped.

Personally, from what I've read, Entity Framework 4 will be a great solution, because it will be able to generate business objects outside the data layer, thus giving a middle common layer. I hope I have understood correctly this about EF4, because I'm betting a solution for my company for this approach when the time comes. Sadly I haven't even installed .NET4 beta in order to actually see with my own eyes, whether the above is true.

Please correct me for any inconstistencies, as I explained that I'm not dedicated on DAL and not tested .NET4

Gravatar

I agree ;-)

Gravatar

I Agree

Gravatar

I agree, and would add that the decisions on whether to use EntityObject, POCO or STE are not obvious.

Gravatar

Shawn,
I have my own opinions on RIA Services but am not quite ready to share them publicly yet. If you want, I can share a rough draft of my thoughts with you. It might change how you look at them.

WRT WCF Data Services, I don't have enough experience to have an opinion either way.

Gravatar

Shawn

Having just about published an article where I compare and contrast these 2 data stacks, I could not agree with you more.

I think there does need to be some work done to unify these 2 data stacks. The sooner the better I think.

Gravatar

I agree.

For us the confusion between Data/RIA Services, has resulted in not adopting either and sticking with the tried and trusted (though thoroughly lacking for how we're using Silverlight IMHO) Web Services solution.

Gravatar

I agree!

Gravatar

Since alot of people seem to be dogging RIA Services in the comments, I will come to its side by stating that I have used RIA Services in 3-4 projects lately (latest one in SL4 Beta) and I have to say that while I agree with your touch points on its lacking abilities, what it does give you is a great Server Side declaration of constraints on your Model.

I think stating Linq2Sql or Entitiy Framework in RIA Services is not a fair point. Since RIA Services exposing ANYTHING in the same aspect. WCF Data Services does not do this, you have to work really hard or use 3rd party tools to get it to do updating on anything but Entity Framework (which I have scrapped using until 4.0 comes out).

The ability to model how and what the client can do at a server level, is incredibly useful and time saving. As well as wrapping up the User Context in a fluent and easy mechanism has been a pain for us in SL2. RIA Services is definitely not perfect, but it is a mile better that what I had to do before.

That all being said, I completely agree with you on the Domain Data Source being necessary. I write all of my Silverlight applications with as much of a strict MVVM pattern as I can (I always have to bend it somewhere though). I have to generate the DomainDataSource in the viewmodel since it gives so much benefit, and allows paging, etc, that is strictly a HUGE pain without it. I feel uneasy doing this, but it saves so much time. I actually created a bunch of really useful Extension Methods for the Domain Data Source to build it in a fluent way for a strictly code-behind way.

Gravatar

(continued)

I also wish Projections were possible in a Change-Tracking way to the original Model you shaped off of it. That would be really useful for the points you made. Particularly when displaying a grid of a summary of data. Why not let them edit that summary on the fly and submit those changes. Not easy in its current state.

Overall though, I am patient with Microsoft's progress in this space and others for Silverlight. It seems like warp speed compared to previous technologies; which is great. MEF, RX Framework, hopefully EF 4.0 (maybe i can retire L2S - projections REALLY quick in L2S, no so much in EF 4.0), WCF as a whole has made my work so much easier and my options on what I can do so open, its hard to see where we were to where we can go.

I agree with everything we need in a 2.0 for both technologies, but for all the commenters posting how horrible it works, lets be real on what was possible 1 year ago, and how great duplicating DTOs and 200 operation methods where. Really?

Gravatar

I think you meant to say "PowerPivot" when discussing OData instead of PivotTable. Otherwise, your assessment is spot on.

In the validation world, I have to wonder what the impact of adding IDataErrorInfo to SL4 will be on frameworks like RIA Services.

Gravatar

I think I agree. :)
I'm not as concerned about the shortfalls of RIA or WCF Data Service as I am that there are 2 in the first place. Like you mentioned with the Linq-2-Sql/EF problem, I'd like to see the resources of these teams used on a single project, not two competing ones.

Gravatar

I want to see the "Shared code folder" die with Silverlight 4. SL 4 and .NET 4 will be binary compatible. The hack is really not needed anymore!

Gravatar

I agree, it's a bit of a mess. Ironically, the option which in my opinion holds the most promise (WCF RIA Services) is currently the one that feels the most awkward to work with (due to the fact that its based on working with declarative data-sources).

Until things clear up, I find myself mostly sticking with plain old WCF Services (feels strange to call these chaps old already :)). I absolutely agree that a more unified approach from Microsoft on this would be welcome.

Gravatar

I don't agree. Data Services and RIA Services are so fundamentally different from each other that I am not sure that merging them in a single underlying platform is possible or even desireable. I also think that trying to compare RIA Services to Data Services and say that RIA Services is missing a feature such as "loading properties" that it has no need for isn't very useful.

I think we are much better off doing a better job of defining the fundamental differences between the two technologies. For example, for someone like you who wants the logic in the client and wants the server component very thin, Data Services is a much better solution. I prefer developing the client and the server together, I prefer dealing with keys instead of object graphs, and I like having the strong DomainContext managing all of my entities so RIA Services is my preferred solution. What makes Data Services good for you is what makes it bad for me and vice versa.

Gravatar

I would like to chime in a little on this too. I think that for the average developer this number of options helps prevent adoption because of the amount of confusion on which is best.

I have spent a lot of time with all the various DALs and have learned which ones work best for certain scenarios but the reality is that most developers don't have that much time to really dive into these technologies. I also think the amount of changes between prereleases is not helping the average developer because it seems that so many blogs are getting information out there, then when the final is released the information is too far outdated to even use. So then when the average developer goes out to learn more or needs help the real answers are watered down by old information.

I have several large projects that I have worked on using Silverlight and wouldn't have it any other way. But there are many developers who won't jump onboard until they are very comfortable with it, so they end up doing stuff the same way they have for the past 10 years.

I think so much of this is not only a patterns and practice problem but also an education problem. Too many development shops are under staffed, overworked and way behind schedule so the last thing they want to do is change how they have been doing stuff. I have been trying to go out and do simple 1 hr lunch and learns to help get people aware of whats out there on Silverlight but it is a big ship to steer when so many developers are comfortable with just standard ASP.net.

On another note in the Entity Framework, why can't they just have the meta data for validation in the designer? It seems like it makes so much sense to put it there to where you wouldn't have to create metadata classes for the RIA services. And this meta data could be used for the other DAL layers.

Gravatar

Agreed, and leads to the proverbial "paralysis by analysis". I seem to have been here though in one form or another with the Microsoft stack since the lates 1980's. :)

Gravatar

I agree.

Gravatar

I eliminated my frustration on day one, when I decided to use none of the above.

We just wrote our own data access code once, and it's done. When MS gets their story straight, we'll consider the bloat size vs the functionality we need, and make a decision.

Gravatar

I agree :-)

Gravatar

Hi Shawn,

I agree, there are too many different ways of doing similar things. RIA services, Data Services even EF are so closely related yet the right and left hands seem to be playing different games. There should be one unified stack. Look at projects like Spring .NET, or the Castle project.

I really want to use this platform for redevelopment of our product but it's really difficult when it's hard to describe what "this product" is.

Gravatar

What I would really like to see is a cleaner separation between the client and server. I should be able to create a set of RESTful services, independent of my UI layer, since the UI is ofen a mix of several technologies - Silverlight, ASP.NET, etc. I want to create "clean" REST services and I am excited by the new work done to WebHttp Services in WCF/.NET 4.

I then want an easy way to deal with them in Silverlight - e.g. RIA Services (or something like it) should be a client-only technology.

Just my 2 cents.

Gravatar

Doing development is for a large part avoiding risks. Therefore it is better to avoid choosing for technologies without knowing the long term consequences, if we can. Using stored procedures + ADO.NET + WCF Services is still a valid option (I guess this falls in your category 'web services'. Sure, I need to write some code (less than 5% of all effort) but it is straightforward, clear, simple, and performing well.
So I just keep using what I know and satisfy my need to learn new things by studying e.g. Silverlight, MEF, and the Rx Framework, until there is something clearly better, matured, and established in the data access area.
(Anyone who has ever needed to do maintenance on an application that used Application Blocks 1.0 (presented as "best practices" at some time) without access to documentation (except The CodeProject) knows how annoying it can be to be tight to obsolete technologies.)

Gravatar

I agree. Our company has been unable to move to Silverlight for a number of reasons. One being the data access. We have a powerful backend workflow engine that manages data in a generic way. Our get data at one place in code looks like this:
Fill(select, table, dataset);
It's done. It's fast and robust. 95% coding is done. All we do is create .xml workflows and publish them to the server.
To get data all we do is pass a workflow name and parameters and a generic dataset is returned. Alot of the winform client details(menus, language strings) are controlled by metadata also retrieved from this web service backend via datasets.
Dataset diffgrams are passed back to the server for updating, logging, transforming, etc.
Still looking for how we can hook it up to Silvelight as a frontend.

Gravatar

What I would really like to see is a cleaner separation between the client and server. I should be able to create a set of RESTful services, independent of my UI layer, since the UI is ofen a mix of several technologies - Silverlight, ASP.NET, etc. I want to create "clean" REST services and I am excited by the new work done to WebHttp Services in WCF/.NET 4.

I then want an easy way to deal with them in Silverlight - e.g. RIA Services (or something like it) should be a client-only technology.

Just my 2 cents.

Gravatar

I think you hit the nail on the head when you suggest that the goal should be functional parity between the access mechanism. I shouldn't have to decide between two similar technologies to retrieve data. All I should care about is which is the more expressive mechanism for my specific situation.

Gravatar

Agree completely!

Gravatar

In our company, I own the data access layer. Because we use a generic dataset, we are able to pass these datasets through a pipeline of workflow processes easily. The beauty of it is it's composible. My coworkers love to code the client to call a workflow with params and get back the data object without the need to also code the transporting and workflow. There is a really clear separation of concerns.

Gravatar

I'm more concerned about the lack of true ChannelFactory support in Silverlight for consuming custom WCF services. We've invested a great deal in building out a suite of true SOA services that model our business domain (by "true SOA services" I mean services designed to meet the needs of more than one client application). For the majority of cases where we need data, we're calling one of our pre-existing services that might have a SQL database behind it somewhere, maybe an Oracle database, or maybe a mainframe. We have many client applications consuming these services - WinForms, WPF, Java, Silverlight, and external customers.

We have many geographically dispersed teams building these services on the WCF stack and trusted clients (i.e. our client apps consuming our services) are .NET and we share a Contracts assembly. This works wonderfully for us, but Silverlight's lack of ChannelFactory support throws a wrench in all of this. We cannot share a Contracts assembly. I'm more than willing to get teams to ship a Contracts.dll and a Contracts.Silverlight.dll assemblies to support both full .NET apps and Silverlight apps, but that doesn't buy us anything without ChannelFactory<T> to invoke the services. Instead, we must generate client side proxy code from Visual Studio (or commandline tooling) and suffer the pain of having clients manage change of the services through the dev lifecycle. This is a big problem for us and it seems like a big gap in the story of Silverlight for LOB apps. I'm going to get a lot of resistance from our development organization without this support in the framework.

I've been trying to get some love from Microsoft on this subject - if you agree, please vote: http://silverlight.codeplex.com/WorkItem/View.aspx?WorkItemId=5008&ProjectName=Silverlight

Gravatar

Yes please!

Gravatar

Having used RIA Services since the CTP version I can wholeheartedly agree with your view. It's a beautiful technology if it only worked in practice as nicely as it seems in demo. There are too many "loose ends" that cause confusion and major debugging sessions when you do anything outside the tiny box.

So yes, I very much agree.

Gravatar

I agree! Especially on your last point about making it possible to inject validation attributes from outside the model. This has caused me much grievance.

Gravatar

I agree!
I like Silverlight, but data access is very big problem! Everything is complicated and with many limitations. Great for presentation video, but horrible for real work!! I know, RIA is in Beta version, but VS2010 is beta too. But difference is really huge.

Gravatar

I agree Shawn,
My wish list is very similar to yours. Asides from projections, I would like end to end support for partially including information from related entities. For instance, if my County entities have a FK to State through a StateID, and I want to show a list of Counties in a grid, I want to be able to fetch the counties plus the state code (CA, TX etc), but not necessarily the whole state entity (imagine that the referenced entity is a big one, like Customer, and I just want the name field). I want to be able to model this as a kind of FK on steroids in the entity framework designer, and then have the SQL join in that extra table to get the lookup name field, bring it back into the entity and over WCF to the client for display in the grid.

Gravatar

Also, I would like to be able to model interfaces in the Entity Model, and have those interfaces be in the generated code. Interfaces need to be a first class citizen, a lot of good practices rely on interfaces and right now I can only see very laborious ways to shoe horn these into the codegen process.

Gravatar

I agree!

Gravatar

I agree microsoft is really not offering any recommendations or any type of unified approach. This has kept us from moving to this platform for a real business application. We decided to use asp.net mvc so we could utilize our existing DAL we have in place. Going to silverlight would mean we would have to completely rewrite (or at least a layer on top) of the DAL. It's really a shame that Microsoft cannot recommend a real end to end solution using this platform.

Gravatar

I agree!

Gravatar

I agree, nice article. I still have one question though, what data access should you use with silver light?

Gravatar

Completely agree - I get tired of telling delegates on my courses that we're in a bit of a half-way house now, "but wait until the next version" - Silverlight interest is growing (if my business is anything to go by), so it is getting more important to have a clear and complete story for data access.

Gravatar

I agree! Too many choices, and none of them really solve the problem of getting data into and out of Silverlight.

I'm down to two choices, RIA Services and "POWCF". Data Services is just out of the question; I don't have time to investigate everyting, and if Data Services really depends on EF, then it's out of contention anyway.

We've had to develop our own ORM - that's less than ideal, but the only way to make our data easily available to services. The ORM is designed to enable service access with a thin wrapper; it works great for WCF (and ASMX), but not so much for RIA services. As already mentioned, support for user-defined types (including collections of same) is crucial. At the moment I'm stuck trying to figure out how to provide certain entities that aren't editable.

I also agree that RIA's attempt to hid the asynchronous aspect is simply a failure. It doesn't hide the asynchronicity, although it does successfully hide things that I want to have visible, like the hand-off of data from RIA to my viewmodel.

You don't have to be doing anything really sophisticated to run into these problems. Try loading a simple ComboBox from a RIA service. I don't want to pass whole entities for the ComboBox, when only a pair of values per entity is required. I'd like to have the first item in the combo box be "select an item", but that seems to require making this an additional entity, and somehow splicing it in ahead of the data as it arrives through RIA Services. And the EntitySet for the combo box doesn't need to be editable, but RIA services balks on not having an Add operation. Maybe there's an attribute for that....

It's enough to drive me back to basic WCF services, but the way that Add Service Reference builds the client config file is daunting once you start to scale up to hundreds of services and deployment to hundreds of customer servers.

I don't even want to think about what that silver light at the end of the tunnel might be.

Gravatar

I agree! Too many choices, and none of them really solve the problem of getting data into and out of Silverlight.

I'm down to two choices, RIA Services and "POWCF". Data Services is just out of the question; I don't have time to investigate everyting, and if Data Services really depends on EF, then it's out of contention anyway.

We've had to develop our own ORM - that's less than ideal, but the only way to make our data easily available to services. The ORM is designed to enable service access with a thin wrapper; it works great for WCF (and ASMX), but not so much for RIA services. As already mentioned, support for user-defined types (including collections of same) is crucial. At the moment I'm stuck trying to figure out how to provide certain entities that aren't editable.

I also agree that RIA's attempt to hid the asynchronous aspect is simply a failure. It doesn't hide the asynchronicity, although it does successfully hide things that I want to have visible, like the hand-off of data from RIA to my viewmodel.

You don't have to be doing anything really sophisticated to run into these problems. Try loading a simple ComboBox from a RIA service. I don't want to pass whole entities for the ComboBox, when only a pair of values per entity is required. I'd like to have the first item in the combo box be "select an item", but that seems to require making this an additional entity, and somehow splicing it in ahead of the data as it arrives through RIA Services. And the EntitySet for the combo box doesn't need to be editable, but RIA services balks on not having an Add operation. Maybe there's an attribute for that....

It's enough to drive me back to basic WCF services, but the way that Add Service Reference builds the client config file is daunting once you start to scale up to hundreds of services and deployment to hundreds of customer servers.

I don't even want to think about what that silver light at the end of the tunnel might be.

Gravatar

Shawn, thanks for this post and commentors, thanks for the follow ups. We've been following this feedback closely as part of a wider effort to understand the usage patterns for both RIA and Data Services to make sure that the alignment produces the best data access stack we can provide for all of our developers.

On a personal note, I agree with most of what I've read on this post and very much want us to come up with something that addresses these requests for my own programming projects, so you can bet I'm pushing, too. : )

Keep those cards and letters coming!

Gravatar

I wish there was some decent documentation on all the new data access systems in .net, I am really struggling and everytime i think I am starting to get it right I hit another road block, for instance it has taken me 2 weeks to get my app to bind to the RIA services and Entity Object model after trying ADO.net Data Serices first (Epic FAIL), now that I have it doing simple CRUD i am trying to get the data annotations setup in the meta class, the bloody foriegn keys are not there and NO one Seems to be able to say how to add data anotations to Foriegn Key colums in RIA? Why are they not there.. well someone decided they arent important so leave them out of the Enity Framework. What the hell has everybody been smoking and what happened to good old fastioned ADO.NET. its like everything has been thrown out the door and the good old robust ways of doing things and lessons learned from them have been forgotten. K.I.S.S, Keep it simple stupid.

Look dont get me wrong I do think this tech has a lot of potential and will be better once there is a clear path for us all to follow, but as it is now it all sucks and I am getting close to abandoning Silverlight and moving back to standard client software sent on CD or for download at least until the whole framework actualy works.

Gravatar

I'm just starting to look at these technologies, so I can definitely attest to the confusion, and I fully agree that the technologies should be aligned.

Looking at early demos of RIA Services, it feels (as in truthiness) like "they're biting off more than they can chew" or "painting themselves into a corner" or ...

Comparatively, it seems Astor...er...ADO.NET...er...WCF Data Services provide a nice open protocol for any client-side technology (PHP and jQuery included). AND, it can sit on top of your IQueryable/IUpdateable repository of choice. Can RIA services not build off of this interface??

Gravatar

We've been going down the EF/Data services road for a large project for the past 4 months. I like the data service train just fine but would like:

- better service operation support. We're considering having a data service for CRUD stuff and also a separate WCF service for the method calls that some developers are so accustomed to. Be nice to integrate these better.

- EF designer support still needs some work IMO. Better support for large models and better export to image support. Would like annotations and better diagramming support. Don't mess up my association lines after I spend so much time making them pretty!!!

Gravatar

Thanks Shawn, at least I don't feel as insane as before. I wish the guys would take pity on poor 'ol coders who like to keep it simple as possible - I'm learning how to get in the Zen state required for Linq, but now I'm faced with a whole load more options for data access - where will it end so I can do some complex types with straightforward add, edit delete available at the client?

Gravatar

I agree

Gravatar

I Agree.

Gravatar

Agree with everyone here. Silverlight is an exciting platform in theory but the data access components are just rediculously complicated. Time is money and you dont want to invest resource learing a tech that could be phased out in a couple of years due to the disjointed development of any of its components. I have the added complexity of having to work with an oracle 10 g back end so even an ado entity model cant be generated (without having to pay for a 3rd party providor which may or may not work). I have spent days looking at the best ways of sending data from clint to server and my conclusion is that it is just not viable atm, development time will just be too great. Why spend days hitting brick walls when existing techs will do a better job. The RIA business application template looks and feels great but for goodness sake, a simple thing like a data driven menu that on click will load a separate silverlight module in the child frame shouldnt be such a chore to implement. GUYS KISS (keep it simple stupid)

Gravatar

Silverlight – Great
.Net – Great
Ria Services – Junk
Entiy Framework – Junk
Please Please Mr Google – Hire the guy in charge of Entity Framework too!
I can’t wait to put down the High school science projects and get down to writing some business applications again.

Gravatar

Great info. I like all your post. I will keep visiting this blog very often. It is good to see you verbalize from the heart and your clarity on this important subject can be easily observed..

Gravatar

DON'T use RIA it's not fit for any real work. All sorts happen on the server why? You cant sort this entity crappo because you can't get to the actual collections to do it. Want to change the ordering of data and return that ordered collection in one call? NOPE. You have to save a entity and then reload them all again. Seriously none of this makes sense,theres 200 trips to the server to do anything. Just rememeber this, all operations can only be done one at a time. You cant update and query in a single call. My favorite is when you add a row of data in a dataform and it fails..the dataform which already added the item then removes it which cause RIA all kinds of pains. Anyone who uses RIA better turn on fiddler and start laughing.
Heres another tip..all children need unique ids even if they have different parents...yeah WOW..what we did was put a property on every object whoses getter returns a new guid just to make this even close to working...

Gravatar

I agree

Gravatar

Hi Shawn,

I agree. I've tested both technologies when I had to start my first LOB SL application (still ongoing in fact). I felt uncomfortable with both. Finally, I was about to implement my own layer over WCF & EF4 self tracking objects, when I finally decided to test something I've heard about a few times: CSLA
And that's really nice! It's a little bit hard to learn, but it's worth it (up to this point). I've been using it for 3 month now, and I can not imagine going back... It needs a lot of time to learn, a full and complete documentation is missing, but the framework is really powerfull.
What I really like in CSLA:
- you have the code, and it's really nice written, it helps you understand what's wrong with yours (code)
- undo feature !! (no roundtrip to server just to cancle a value)
- real validation (with custom rules where you can apply any type of constraint)

A real business object layer!!

I'm just trying to know why people do not consider this solution.

Christophe


 



 
Save Cancel