Accidentally birthing a framework

Dec 28, 2005 12:10


I completely refactored EventQueue so that it oculd have Handlers. What this means is that now I can have a mod_perl, mod_perl2 and cgi handler and I can move the Static view to be a handler because that's what it essentially is. The Handler is responsible for taking the environment and splitting it into things EventQueue needs such as the path fragments, the current on disk location and the root.

Whilst doing that I simplified the Action and View mechanisms so that you have an Action (say a month) and it's merely your responsiblity to populate a hash of options and pass it an EventQueue instance. I can easily write a static handler (for testing purposes) by populating a hash and then calling EventQueue with multiple fake paths with interesting days, months, years and events.

Whilst I was at it I made it so that an Action (the aformentioned days, months, years and events) are responsible for saying whether they can handle a given path or not. This cleans up the code considerably and allows 3rd parties to write plugins. Not only that I was able to move the checking for static files (so that we can have images etc etc in the same directory) into an Action.

Much happier with the design now.

hash, environment, static, plugins, fragments, cgi handler, mod perl, action, path

Previous post Next post
Up