views:

79

answers:

1

I'm on a Silverlight 4 + MVVM project using ASMX for services.

I'm finding the DataForm to be cumbersome. IEditableObject, bindings, etc seem to be a pain. I've done some forms in my application without the DataForm and they've worked out really well.

So I guess my real question is, what does the dataform give me that hand bombing a form wouldn't? Is it the editing of multiple records at the same time? Because this seems like a recipe for a concurrency nightmare.

+2  A: 

Not sure about your specific situation, but I can answer from an RIA Services perspective (which specifically benefits from the DataForm).

RIA Services passes Entities to your silverlight application. These enties are already RESTful, and already implement the IEditableObject interface (benefit #1), they also can carry meta-data such as field requirements, navigation properties, valid ranges, error messages, etc. By default Entity Framework and RIA Services will start you off by carrying this meta-data as defined in your data source (such as SQL) with no effort from you (benefit #2). Using one of the built-in collections, such as CollectionViewSource, or DomainDataSource provide navigation implementation (via ICollectionView interface) (benefit #3).

Based upon what you stated, it sounds like you are passing data in a fairly manual manner, and you may not gain these benefits immediately.

To gain some of these benefits, try adding meta-data to your model object (by adding attributes from the System.ComponentModel.DataAnnotations namespace.), try using CollectionViewSource to implement filtering, sorting, and naviation of your collection.

Ryan from Denver
Very interesting! So if I'm not using RIA then benefits 1+2 are moot.. and I should look into CollectionViewSource for #3.
itchi
None of these have to be moot, I would suggest looking into the meta-data attributes, which will gain you the benefit #2, the CollectionViewSource does also add some great benefits for #3. Neither of these require RIA services. As is most things, really depends on your situation...
Ryan from Denver
I'm already annotating, but their benefits aren't tied entirely to dataforms.
itchi