views:

25

answers:

1

I'm currently looking at RIA services, in order to speed development of Silverlight enterprise applications. It's clever and powerful, but it seems to me that you are invariably going to collapse your business logic into the presentation layer. Is there any place for a classic BLL (business logic layer) when using RIA?

Update: Did some more research. Looks like current accepted best practice is to implement RIA with MVVM, with the VM operating as a client side class, and containing your business logic.

+1  A: 

Answering your update first: The view model's role is to provide the properties the view needs to display and control visual state. It is not a good place to hang your BLL (or controller code or any other junk... which seems to be accepted best practice also :) ).

RIA itself is open-ended by virtue of using Partial classes. Simple Business rules go into the RIA metadata.cs file and complex rules (referenced in the same metadata file) can go into Custom validators.

I seem to remember you can also override all the xxx_changing and xxx_changed events in RIA.

The question now is what sort of rules are you trying to apply?

Enough already
Fairly minimal business logic rules, as it happens, but I wanted to know the "right way" to do it. Come to think of it, it's rare for our business layers to do much more than validation...
CraigS