Tags: mod perl

diesel, learning, evil, sweeti

Accidentally birthing a framework

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.

diesel, learning, evil, sweeti

AJAXy vs RESTian

There is, it seems, a Soloman-esque dilemma that faces those who wish to be buzzword compliant.

Obviously a meaningful RESTian URL is important. EventQueue already has this

    # Show a year
    http://thegestalt.org/simon/eq/2005/ 
    # Show a month
    http://thegestalt.org/simon/eq/2005/12
    # Show a day
    http://thegestalt.org/simon/eq/2005/12/15
    # Show an event
    http://thegestalt.org/simon/eq/event/palm-datebook-007f9a18-000076

However certain aspects of navigation - moving between days, weeks and months and years would certainly benefit from some AJAX which would leave the url inconsistent with the display.

Week in particular would benefit from the ability to slide left and right by one day.

I suspect, however, that a meaningful URL is more important.

One solution, from Tom Insam, is to have

    http://thegestalt.org/simon/eq/#2005/12/15

etc and parse the parts in Javascript which seems a bit icky but might just work. Especially since it will allow the same URL to be shared whether the handler is mod_perl or cgi without the need for mod_rewrite.

diesel, learning, evil, sweeti

What needs to be done for EventQueue

After my last excursions in AJAX and DHTML I feel slightly more confident about hacking together the last bits of EventQueue to make it full functional.

However, before I release it I really want to make it so that it can have multiple backends (mod_perl 1 & 2, cgi, static) which shouldn't be too hard but means that it's become suspiciously Framework like.

*shudder*

Framework - the verboten word.