Using BasePage for common usage, MVPC Pattern question,Arch

Topics: Web Client Software Factory, Project Management Forum, UIP Application Block discussion, User Forum
Dec 10, 2007 at 1:26 PM
I`m using WCSF, i have
3 buisiness modules: Admin,Economy,Messages and
1 Foundation module where i define all wcsf services which are used by Buisiness modules such as: UserFactoryServices,RoleFactoryServices.
1 Class Module where i define all common interfaces,entities : IUser,User(All validation are defined there) example of UserClass in Common Class Module:
string Comment { get; set; }
string Email { get; set; }
Guid Id { get; set; }
bool IsOnline { get; set; }
string Name { get; set; }
string PasswordQuestion { get; set; }
bool Status { get; set; }
string SureName { get; set; }
string Telephone { get; set; }
string UserName { get; set; }
and in Services i work with this entitie as :
IDataReader GetKopejasGrupas();
IDataReader GetManasGrupas();
DataSet GetAllSaimniecibas();



and i have some questions about arch.... what aspx code behind should do in WCSF,what should Presenter do.
If i need to check : Show somebutton or not show.... dependence on UserRole. Is this logic to define "BasePage" and inherit all pages of BasePage ? or should i process all UI logic in presenter and define Property in IView(View Interface) and populate it with public override void OnViewInitialized() ?

And one more question about Arch : What WCSF Services do, if i`m writing Service to Get Data from DataBase, services should return IDataReader and in Controller i should work with it or should it return ready data well-formated?

Pleace could you give some links on patterns which are use in WCSF(i understand that in WCSF it is not MVC,not MVP, it is MVPC but i `m not sure what i should put in services,controller,presenter,aspx code-behind)
Dec 27, 2007 at 3:24 PM
Hi


i have some questions about arch.... what aspx code behind should do in WCSF,what should Presenter do.
If i need to check : Show somebutton or not show.... dependence on UserRole. Is this logic to define "BasePage" and inherit all pages of BasePage ? or should i process all UI logic in presenter and define Property in IView(View Interface) and populate it with public override void OnViewInitialized() ?

Pleace could you give some links on patterns which are use in WCSF(i understand that in WCSF it is not MVC,not MVP, it is MVPC but i `m not sure what i should put in services,controller,presenter,aspx code-behind)


I recommend you to see the MVP bundle. You will find in its documentation the pattern description and guidance about how to implement it (among other things).
You can also see the E-Commerce Catalog reference implementation in WCSFContrib.


What WCSF Services do, if i`m writing Service to Get Data from DataBase, services should return IDataReader and in Controller i should work with it or should it return ready data well-formated?


A service is name for an object that provides functionality to other components (the components can be in the same module or in another module) in a loosely coupled way.
In your case (the service that return IDataReader) you should format the data in the Controller if all the presenters/views that use that controller shared data format. Otherwise, I recommend you that the logic of format the data be placed in the presenter.

Please let me know if this helps.

Mariano Converti
http://staff.southworks.net/blogs/mconverti/