tags:

views:

73

answers:

1

Josh Smith loaded the dummy data on the Model on this demo, while Tim Heuer loaded the dummy data on the ViewModel on this demo.

Which one should I follow? :S

+3  A: 

VMs are part of your UI layer. Good separation of concerns dictates that the responsibility of loading data should be moved to another layer. Generally I do this by using a data service that loads the data into a model. The service and model is then consumed by view models.

Note that your VMs can use said service to load data at appropriate points in your application. However, they should not contain the actual logic to load your model.

HTH, Kent

Kent Boogaart