Silverlight 4 - RIA Services - Is it Good Coding Practice?

I am new to Silverlight. I spent a day looking at RIA services. The concept seems very enjoyable and a way to save a lot of time creating data-driven Silverlight applications. However, during the time I spent with him, I left with the feeling that many may feel that the approach is too “quick and dirty” and will violate at least a few best practices.

For example, by default, the basic level of service doubles as the level of data access. And there seems to be a close relationship between the database objects and the user interface.

I would really like to receive comments from experienced Silverlight / RIA developers on these issues, and possibly others that I don’t notice. I like this concept, but I am concerned that those who are more code purists than me will not agree to this approach.

+4
source share
1 answer

I think RIA Services encourages great templates (with the possible exception of DomainDataSource, which many will use for data access logic in a view, but I know that RIA Services people are considering ways to make DDS more MVVM friendly). Here are some specific points that I like in terms of architecture:

  • The verification logic can be formulated once, but both client (pleasant UX) and server (security and consistency for clients that are not SL this service) are used.
  • Requests are performed between levels, so you can think about what you want / need on the client, formulate a request and know that it will be completely transferred to your database without excessive selection. You can do all this without thinking about optimizing SQL queries, etc., but getting many hard-to-reach advantages.
  • Due to the fact that everything is binding, it becomes easier to use MVVM so that your views are simple and silly. Data binding is your friend, and RIA services are not too tedious / tedious to implement INotifyPropertyChanged again and again, plus it adds many other more complex interfaces like INotifyDataErrorInfo (I think), and IEditableObject etc. that many Silverlight control from boxes to "do the right thing."

I think I don’t understand what you mean by doubling a service as DAL - DAL is your model from LINQ-To-SQL or LINQ-To-Entities (or any other DAL that you like, NHibernate, etc. ) RIA is more of a business logic layer that sits at the top of the DAL and provides data in a way that matches business logic with consumers. In the case of Silverlight, it also adds client code for client-side validation, etc., but it's just adding a value for Silverlight.

There may be a tight connection between business objects and the user interface, but this can be done using any technology. Providing the right data and then creating a user interface on top of it is something you should think about regardless of technology.

+2
source

Source: https://habr.com/ru/post/1340500/


All Articles