jwma's Architecture - Controller Element
 
Main | Deployment | Configuration | Architecture | Development | Screenshots | SF Project Site
Index | Overview | Model (M) | View (V) | Controller (C) | Other Elements

Understanding the Controller Element


As outlined in the overview, this architectural element receives and handles the requests originating from clients on the network. In one transaction (i.e. Request-Response) a controller has following tasks:
  1. Maintain session
  2. Handle and verify input data (e.g. request parameters)
  3. Manipulate or instantiate model objects according to requested action
  4. Store or update model instance references (in the maintained session)
  5. Redirect to an appropriate view
The controller element is supposed to be created and maintained by a controller programmer. It should be based on the controller programmer's perspective of the model (see model documentation).


jwma's Abstract Controllers

As jwma provides a lot of functionality, a virtual division of the controller element based on sets of functionality has been introduced, resulting in 4 abstract controllers. These are listed and described in Table 1.

Abstract controller (name) Description
Main Controller handling all session, postoffice and preferences related requests.
Mailing Controller handling all mail transport related requests.
Contacts Controller handling contact management related requests.
Admin Controller handling administration related request.
Table 1: List of Abstract Controllers

Requests related to a specific functionality will be send to the controller registered for fullfilling the task of the abstract controller. While a simple implementation probably might want to register 4 servlets specialized for the specific functionality, it is perfectly valid to register one single controller for all.
This allows the implementation of the controller element using an arbitrary development framework like Struts, Expresso etc.


A Standard Implementation - Servlet Based Controllers

jwma is distributed with a standard implementation based on plain servlets (i.e. specialised HttpServlet implementations). These are well documented in the development documentation.


© 2000-2003 jwma team