|
Hi,
Getting Started
To get started with the WCSF I would recommend you to check out the
Labs
(although the labs are for the 2007 version, you should still be able to get some important concepts from them) and
Quickstarts (you have to install the source code to use the Quickstarts). To accompany the labs you could check out the
MSDN Documentation.
As for a base for standard approach when using WCSF, you can check the
Bank Branch Reference Implementation.
To use the Global Bank Reference Implementation you must install the
WCSF - February 2008
source code. The WebClientFactorySourceInstall.msi installer is located in the
Source folder located in the directory where you installed the factory.
Once you have installed the source code you should be able to open the Global Bank solution located under the
GlobalBankRI folder.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Regarding where to place the logic to update your gridview/datagrid, there are different implementations of the MVP pattern,
which should be chosen according to your testability needs. Depending on the implementation of the MVP pattern you are going to use, the relation between the Model-View-Presenter varies.
Passive View
The interaction with the model is handled only by the presenter; the view is not aware of changes to the model.
Implementation
The event handlers in your application should be in the Presenter. Its responsibility is to get the events raised by the view and use the model according to the business rules. Once the model is
updated the Presenter’s has to notify the view, so it can refresh itself.
Example
View Code:
private
void printGridButton_Click(object sender,
EventArgs args)
{
_presenter.PrintGrid(args);
}
Presenter Code:
public
void PrintGrid(EventArgs args)
{
// Your printing code…
View.ShowMessage("Print Successful");
}
Supervising Controller
The interaction with the model is handled NOT only by the presenter. The view uses DataBinding to update itself when the model is updated.
Implementation
Unlike the previous implementation, the View has knowledge of the Model. Through databinding, when the model is updated so is the view, thus avoiding having the presenter notify the view of the
changes to the model. This is useful for non complex UI changes. This implementation makes your view less testable.
For more information about the MVP pattern you might find useful:
·
Model-View-Presenter Pattern [WCSF]: Describes the two implementations of the MVP pattern mentioned
above.
Please let me know if this helps.
Damian Schenkelman
http://blogs.southworks.net/dschenkelman
|