[Seaside] comanche modules design

Stephen Pair stephen at pairhome.net
Mon Apr 14 18:51:09 CEST 2003


Avi Bryant wrote:

>On Mon, 14 Apr 2003, Stephen Pair wrote:
>
>  
>
>>What about the following case? ...I plug a Session module into the base
>>ComancheHttpService.  Then I put a ChieftainModule behind the Session
>>module and it's going to want to dispatch #processHttpRequest: not
>>#processHttpRequest:session:...at which point, you've lost the session
>>info and any modules you plug in behind the Chieftain can't access the
>>session info.  The problem is compounded when you consider that you will
>>likely want some type of module that resolves a user based on the
>>session.  Extending this pattern, you'd then need to add
>>#processHttpRequest:session:user: and #processHttpRequest:user: to all
>>Modules.
>>    
>>
>
>Fair enough.  What about a Context object, then?  Rather than pass
>separate request/session/user along, and rather than have a set of
>implicit, dynamic bindings, pass an explicit context instead - it can be,
>for example, request + response + dictionary of other bindings.
>
>You can implement a default handler maybe like:
>
>processHttpContext: aContext
>  aContext response: (self processHttpRequest: aContext request)
>  
>
Yes, perhaps doing something like this would be a good alternative to 
the use of dynamic bindings.  I think I still prefer the dynamic 
bindings approach though.

I could use dynamic bindings to support 'HttpContext current', and use 
that to indirectly support HttpRequest current, HttpResponse current, 
etc.  If you don't have dynamic bindings loaded, then you cannot use 
those methods and you'll have to explicitly pass the HttpContext around.

However, this is a lot of effort to get to a solution that doesn't use 
DynamicBindings...is it really worth that effort?  I can always bundle 
DynamicBindings with ComancheNG.

Btw, I've been looking at some of the Apache modules and think that we 
could have a lot of fun building some of them for Comanche 
(mod_log_config and mod_cgi (using OSProcess) are two that would be 
really cool to have).  I have an Apache compatible logging capability in 
the old Swiki.net code that I could pull forward and convert into a 
ComancheNG module.

- Stephen



More information about the Seaside mailing list