How do i customise WCSF to remove presenter layer

Topics: Web Client Software Factory
Jan 22, 2009 at 10:04 PM
I am new to the MVP pattern , however i have done some implementations using MVC
I want to minimise the development effort involved in MVP which has 4 diffrent layer View, Presenter, Model and Controller
Does anyone know how to customise the MVP to have only three layer
Here is the approch

1. View implementing Iview
    On page load create Controller passing Iview to controller

2. Controller : This gets view object and calls the methods defined in Iview passing Model

3. Model repsents Data
Jan 23, 2009 at 12:13 AM
What you are trying looks not like customization but replacement.
Jan 23, 2009 at 2:13 AM

First, I need to clarify some confusion.  The implementation in WCSF is:

  • MVP -- three pieces of the typical pattern.
  • Application Controller (or scenario controller) to help tie together functionality that spans multiple views. 

So, there are really only 3 files in the MVP implementation.

However to answer your question...

  • first, I recommend reading the docs on the MVP pattern to make sure you really understand the differences between it and MVC, as they are significant and important, especually if you are going to make changes used by others. 
  • second, read up on GAT and GAX
  • third, look at the source code for the WCSF guidance package, start hacking, and create your own version of the factory.

I hope that helps a bit,
Michael Puleio -- patterns & practices
http://blogs.msdn.com/mpuleio

Jan 23, 2009 at 6:28 PM
Thanks , I went through the documentation . However i still have question "Do i really need Supervising Controller " Is it possible to  remove controller and place the view update logic in presenter? Please advise
Jan 26, 2009 at 2:14 PM

Hi,

 

It is not necessary to use the controller class in your application and you can remove it from your Business Module without problems.

Like Michael Puleio said, the controller class is a good place to share logic between your presenters, however, you don’t have to use it and you can implement all the logic in the presenter but this may cause some code duplications.

In fact, when you create a new view using the WCSF’s Guidance Package, the resultant presenter class does not have any reference to the Controller class of your Business Module. To be able to use it, you have to perform the described steps in the following article:

·         How to: Use a Module Controller from a Presenter

 

Please, let me know if this helps.

 

Ezequiel Sculli

http://blogs.southworks.net/esculli/