Edgewall Software

Changes between Initial Version and Version 1 of VcRefactoring/Controller


Ignore:
Timestamp:
Mar 19, 2007, 1:24:53 PM (17 years ago)
Author:
Christian Boos
Comment:

Describe the Controller related refactoring going on in the source:sandbox/vc-refactoring branch

Legend:

Unmodified
Added
Removed
Modified
  • VcRefactoring/Controller

    v1 v1  
     1= VcRefactoring/Controller =
     2
     3Following-up on the [googlegroups:trac-dev:b08a7132c7d76fd8 refactoring started by Peter Dimov], there's an opportunity to revive the TracDev/Proposals/ControllerApi effort.
     4
     5The `RequestProcessor` class encapsulates all the logic for processing one specific request.
     6It was therefore natural to extend it with the response helpers and the dispatching logic that was previously attached to the proposed Controller class. As that class was a Component mixin, it was not convenient to keep Request related state at that level.
     7
     8''Work in progress''
     9
     10Currently done:
     11 - automatic dispatching to specific methods of the `RequestProcessor` subclass, based on the `action` parameter. Those methods are named `do_<action>` for a POST request, `render_<action>` for a GET request and `call_<action>` for an [wikipedia:XMLHttpRequest XML Http Request] (also, `self.xhr` is set to `True` in the latter case).
     12 - `default_template`, `default_content_type` properties can be set at the `RequestProcessor` subclass level, so that only the data dictionary needs to be returned by a handler
     13 - `default_stylesheets`, `default_javascripts` properties can be set at the `RequestProcessor` subclass level, for 'text/css' stylesheets and 'text/javascript' scripts that will always be associated to the responses.
     14
     15TODO:
     16 - move the matching logic at the level of the `RequestProcessor` itself
     17 - find a better name for the `call_<action>` methods for handling XHRs (the default XHR handler is named `call_view` which doesn't look good)
     18
     19----
     20See also: VcRefactoring, source:sandbox/vc-refactoring