in reply to Re: RFC: Apache::Controller
in thread RFC: Apache::Controller

Thanks for your comments! I will definitely give them some more thought, but here are some of my initial reactions.

First things first: I don't think the "perfect" framework for web applications has been invented yet

I agree, but before we start off with the wrong idea, I'm not really attempting to build an entire framework. I'm only trying to make one part of it -- the controller. And a very limited controller at that.

One thing I don't like is that the template is too tightly coupled to the action - it's entirely possible that several related actions want to use the same template

This is true, and probably something I'll put in eventually. I could easily extend the contructor to take in template names for the actions, along with the module names. I'd keep the default behavior of template name being the same as action name, though, because it's quite convenient.

or for an action to have more than one resulting template.

I'm not so sure about this. I would either make the template flexible enough to handle everything the action needs, or to create two different actions.

Also, I'm sceptical about using classes to describe actions.

Well, I don't know if this has any bearing on your argument or not, but I'm not really using classes. Just plain old Perl packages. The main purpose they serve is to contain the handler subroutines, but they also make for a nice separation at the filesystem level, which I like.

Lastly, I would like more hooks in the code - some place to do general setup or session management would be nice for instance

This is a perfect example of why I don't like the name I've chosen. I'm not attempting to write an end-all, be-all solution, just something that lets me get some stuff done. These features would definitely be useful in many applications, but for what I'm doing, they'd just get in the way. Maybe there's a better way to name my module that conveys that message?