Reputation: 48422
I'm pretty new to Silverlight. I've spent the day looking at RIA services. The concept seems very nice and a way to save a lot of time writing data oriented Silverlight apps. However, in the time I spent with it, I came away with the feeling that many might feel the approach is too "quick and dirty" and would violate at least several best practices.
For example, by default, the back-end service layer doubles as the data access layer. And there seems to be tight coupling between database entities and the UI.
I'd be very interested in getting some comments from experienced Silverlight/RIA developers on these issues, and perhaps others I'm overlooking. I like the concept, but my concern is that those who are more code purists than I am would balk at this approach.
Upvotes: 4
Views: 342
Reputation: 3116
I think RIA Services encourages great patterns (save maybe for DomainDataSource, which many will use to put data access logic in the view, but I know the RIA Services folks have been looking at ways to make DDS be more MVVM-friendly). Here's some specific points I like about it from an architecture perspective:
INotifyPropertyChanged
over and over, plus it adds lots of other great harder-to-implement interfaces like INotifyDataErrorInfo
(I think), and IEditableObject
and so forth, which many Silverlight controls respect out of the box to "do the right thing".I guess I don't follow what you mean by the service doubling as a DAL - the DAL is your model from LINQ-To-SQL or LINQ-To-Entities (or whatever DAL you like, NHibernate, etc..). The RIA Service is more of a business logic layer that sits atop the DAL, and exposes the data in a way that keeps the business logic consistent across consumers. In the case of Silverlight, it also adds the client-side codegen to do client-side validation and such, but that's just a value-add for Silverlight.
There can be tight coupling between the business entities and the UI, but this can be done with any technology. Exposing the right data, then building a UI on top of it, is something you have to think about regardless of technology.
Upvotes: 2