Christian Boos wrote:
> instead of using an API of the LogRequest class. process() is a generic 
> method from the parent RequestHandler class, which will dispatch to the 
> appropriate method of the subclass according to the action parameter 
> ('do_<action>' or 'render_<action>' ones, the former for GET requests 
> and the latter for POST requests). This is not that useful for the 
> LogRequest, where the only action is 'view' (the default), but would be 
> for other handlers.

The RequestHandler idea is great! The definition of RequestHandler
should be moved elsewhere though. You'd know better than me which module
is most suitable.

Do we really need two different handlers ('do_<action>' or
'render_<action>') for the *same* action? I wouldn't actually care
whether I got the data form the query string with of a GET request or in
the message body of a POST request... all the handler should care about
is to get the data and handle the request. Or maybe there's a difference
in the way trac handles GET and POST requests that I'm unaware of?

> I also changed the methods a bit to make more apparent what step they 
> were doing, by using a more functional style:
> 
> def render_view(self):
> history = self._get_history_provider()
> items = self._get_log_items(history)
> data = self._get_template_context(items)
> 
> if len(items) == self.limit+1:
> ...

Nice! :-)

>> I plan to do similar refactoring to ChangesetModule before proceeding
>> with the version control api refactoring. Actually I would further
>> refactor LogRequest and ChangesetRequest to use the "perfect" version
>> control api. I guess we would have some discussion about how perfect it
>> is before actually going ahead and changing it ;-)
> 
> Please take a look at my updated patch. If we both feel we can achieve 
> something going on this way, maybe we should restart a vc-refactoring 
> branch ;-) As you proposed, we should first start there by some 
> clean-ups and refactoring of the current code base.

Yes, we will definitely achieve something! I hope I'll be able to
refactor BrowserModule and ChangesetModule and provide a patch for
review by the end of the week :-).

Regards,

Peter

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to