Brainstorming for context oriented API

Idea

Split up the current Request object into smaller context oriented objects, which are passed down to the methods instead of 'request'. Example: methods working with parser/formatter get passed a RenderContext with appropiate attributes instead of the classic 'request'-object, which held all information at once.

Which contexts should be provided? What is needed to be present on them? Any questions on the implementation?

HTTPContext

Typical responsibilites:

Method in the old API

Functionality in the new API

setHttpHeader

Provided by 'Response'-property

getUserAgent

Provided by 'Request'-property

parse_cookie

Provided by 'Request'-property

setURL

Provided by 'Request'-property

rewriteRemoteAddr

?

rewriteHost

?

rewriteURI

?

makeURI

combination of provided 'Request'-properties

setIsSSL

Provided by 'Request'-property

setHost

Provided by 'Request'-property

getPathInfo

Provided by 'Request'-property

setContentLanguage

Provided by 'Response'-property

emit_http_headers

Provided by 'Response'-property

getScriptname

Provided by 'Request'-property

redirect

Provided by 'HTTPException'-objects

MockHTTPContext (for debugging)

RenderContext

Method in the old API

Functionality in the new API

loadTheme & initTheme

?

redirectedOutput

?

write

returning 'Response'-objects

normalizePagename

put into a library package

setPragma & getPragma

should be put unto Page objects (is page metadata) => sync with ChristopherDenter

ScriptContext

MoinMoin: FlorianKrupicka/SOC2008/ContextObjects (last edited 2008-05-31 14:39:07 by FlorianKrupicka)