Is shifting all Business Logic of Views to Controller(module) necessary?

Topics: Web Client Software Factory, User Forum
Jul 31, 2007 at 9:13 AM
Hi Everyone,

I started working with WebClient few days back, although have fair knowledge of SmartClient. I wanted to know one thing, In GlobalBank example Application-Controller pattern is used throughout. I understand if PageFlow navigation is required we can have the Navigation logic in Controller. But can we separate some logic to presenter rather than pushing all the logic to the controller(module). As far as i understand Presenter shall react to events caused in view and also has the capability to respond to it. (We can inject Service and take it further)

To be specific in GlobalBank Example(EFT Module), NewTransferViewPresenter for all the methods logic is written in controller. Can we avoid it?

In smartclient we used to have workItem Controller, where in we can have use-case related logic. But as we dont have the concept of WorkItem(I would like to know whether its in pipeline or not) we cant do that.

Please shed some light to this.

-- Wali
Jul 31, 2007 at 4:43 PM
Edited Aug 1, 2007 at 2:41 PM
Hi Wali,

The application controller pattern’s main goal is to centralize the flow of the application and screen navigation, so that you can change flow or logic in a single location, with no changes (or minimal changes) to the source code of views. If your application contains areas that do not have intensive page flow logic, you might want to avoid using the module controller for them. Module controllers follow the Application Controller pattern (see the WC-SF docs for more information (Inspecting the Software Factory Assets -> Patterns for Web Client Applications -> Application Controller)), which might not be the best solution in these scenarios because usually there is little or no page flow / business logic in them. In these cases, you could wrap business-specific logic in module services and consume them directly from your presenters, as you typically do in SC-SF.

Cheers!

Sebastian Iacomuzzi
http://staff.southworks.net/blogs/siacomuzzi
Aug 1, 2007 at 6:31 AM
Thanks Sebastian, that would surely answer my query.

-- Wali.