Help with Dashboard Design

Topics: Prism v2 - Silverlight 4, Prism v4 - Silverlight 4
Aug 30, 2010 at 3:19 PM
Edited Aug 30, 2010 at 3:49 PM

Hello, I am creating a Silverlight dashboard application and would appreciate any advice

Each dashboard has a collection of widgets. The widgets all present the same sort of data but in different ways (each widget will have its own View Model).

My question is how should Widgets be managed in terms of configuration (configuration for each widget is stored as a single row in db accessed using the widgets GUID) and data access.

1:  Widget manages itself, widget will load it's configuration from the db using appropriate injected service (dashboard manager provides widget GUID ID) and then load the data to display again using appropriate injected service. 

2:  Widget is dumb (it doesn't know how to load configuration or data to display. All configuration/data would be provided by the dashboard manager

3: Widgets are passed the configuration by the dashboard manager and then widget uses the event aggregator to subscribe for data (passing a data request template), the idea here is that there would be 1 data manager that would be a single source for all the data displayed within the different widgets/dashboards.

I know this quite a broad topic but I am sure the concept of a dashboard with widgets is a common design issue.

 

Sep 15, 2010 at 10:18 PM

Currently, Prism doesn't have guidance regarding your scenario.

Any of your approaches might work, but to determine which is the best one, it greatly depends on your concrete scenario.

Nevertheless, in my opinion the 2nd approach is a good one because it has low coupling. Remember that the logic of accessing the database should not be in the widget, but in a separate class, which could be the Dashboard manager.

Regarding the 3rd approach, remember that the Event Aggregator is used to communicate between modules. So unless you have to communicate between different modules, I wouldn't recommend using it for this functionality.

 

Hope this help,

Diego