It doesn't really matter in speed but the first approach is still better because:
- It follows the mvc design in which a model doesn't know about a view.
- If in a later stage of development, you'd have to add functionality that alters the data. This could be as simple as filtering or sorting.
Even if, in this case, your data isn't altered, you should still stick to the better design pattern.
In my case I have a mediator class for each view component (using robotlegs framework) and the mediator knows about the view (not the other way around of course.) It's in this mediator that the remote service call is handled and I change the datasource of the underlying in the view.
It's not a big deal though for me to just put the bindable datasource xml on the view component iteself and just modify that from the mediator so I'll probably go with that approach. Seems, like you mentioned, the most flexible that way.
No, if you use a mediator, load the xml in a variable handled by the
mediator and bind your view to that variable. Don't bind the xml directly to the view!