Large Prism/Silverlight application - multiple modules talking to single data service

I am developing the framework for what will be a large data-driven Silverlight application using Prism. I am creating multiple modules for different pieces of the application, but all modules need to access data from the same REST webservice. So my initial plan was to create a separate module for the data retrieval and use EventAggregator to then pass results to the other modules that subscribe to the result event. The data module will not have a ViewModel since there is no View.

So a couple of questions: 1. Is the way I have described a good way to do this - one module feeds the others? 2. Where in the data module can I publish events if there is no ViewModel?

Any tips or advice are much appreciated.

Answers


You can publish events in any component, by just getting the EA injected. In this case you would probably publish the event once the data retrieval is complete.

However, this might not be the best approach. The one I would take is creating an interface for the WebService and registering it in the container. Differnt modules can get the service implementation from the container and request the data on their own without depending on a "feeding notification".

There are many threads discussing this in the Prism forums at Codeplex.


Need Your Help

Null pointer exception when trying to get value of EditText field from Fragment

android android-fragments

i am trying to build a little project which uses tabs with two different fragments shown, depending on which of the tabs is selected. Both fragments contain EditText fields from which i want to sa...