[tpm] Talk volunteer... not for today though
Dave Doyle
dave.s.doyle at gmail.com
Fri Oct 31 13:20:06 PDT 2008
The run method has been broken up a bit but into __get_body and
__get_runmode. Not particularly overridable but it has been broken out.
The run method is almost nothing more than a list of callbacks now.
Mark did change from Class::ISA to Class::MOP (Moose underpinings) to
examine the parent classess of the currently running app (which was used
when doing callbacks) but reverted back to Class::ISA after he determined
there was a performance hit when using Class::MOP. I wasn't aware that he
had been playing with a full Moose implementation though.
Also, I added a function for headers after reading Cees complaint in the
comments of CGI::Application::Plugin::Session. That is, header_props
clobbers all the current headers, header_add will merge together multiple
headers of the same name if needed but doesn't clobber the previous values.
I've added header_set which is essentially the same as head_add but it does
clobber each individual key.
For example if you did $self->header_add( -cookie => $cookie ) and then
called $self->header_add( -cook => $another_cookie ), the two would be
rolled together and both cookies set. With header_set, if you do
$self->header_add( -cookie => $cookie ) and then later did
$self->header_set( -cookie => $another_cookie ), the $cookie gets
clobbered. This way you don't have to do a full header_props call to
replace one particular header. The adapted version of CAP::Plugin::Session
actually uses that now.
As to HTML::Template coupling... shall I incorporate
CAP::Plugin::AnyTemplate into the core? :) My shamelessness and theivery
knows no bounds.
D
On Fri, Oct 31, 2008 at 4:05 PM, Michael Graham <magog at the-wire.com> wrote:
>
> > So, anyone have a part of CGI::App that they particularly hate? :)
>
> I can't remember all the details of what people were talking about. I
> do remember:
>
> * the run method does too much and is hard to override - it should be
> broken up into smaller, easily-overridable methods. (This might
> have been done already.)
> * HTML::Template is too tightly coupled
> * managing HTTP headers is a complete pain
>
> > I'm kinda terrified to mention it on the CGI::App mailing list for
> > fears of getting back "are you insane... lightweight web framework +
> > moose = oxymoron!"
>
> As long as you're careful to label it a research project and not a
> replacement, I don't think you'll get much flamage on the CGI::App
> list.
>
> Also, I think Mark Stosberg started a rewrite of CGI::App awhile back in
> Moose, didn't he? Or was it in in Pugs?
>
>
> Michael
>
>
>
> On Fri, 31 Oct 2008 11:55:48 -0400
> "Dave Doyle" <dave.s.doyle at gmail.com> wrote:
>
> > Well, I've got virtually 100% now. The only thing it's not doing is
> > allowing you to use QUERY, TMPL_PATH and PARAMS in the constructor
> > (they must be lowercase).
> >
> > Full test suite is passing now. Any suggestions for improvement is
> > more than welcome. :) As I said, I've incorporated TT and a stash.
> > I was thinking of chucking the callback system altogether since Moose
> > allows you run code before/after/around any method. Roles/Plugins
> > that compose into the main class can use these hooks as well. I'm
> > not sure if a plugin author would find that appealing though. I
> > guess it depends. I've also made some minor cosmetic changes as I'm
> > a fan of the ternary operator instead of if(condition) { x =
> > something } else { x = something else}.
> >
> > So, anyone have a part of CGI::App that they particularly hate? :)
> >
> > I guess I'll see when i get my PAUSE id (how long does that take
> > anyhow it's been a little bit but I haven't heard back?) i can throw
> > it up on CPAN and see if anyone is interested. I'm kinda terrified
> > to mention it on the CGI::App mailing list for fears of getting back
> > "are you insane... lightweight web framework + moose = oxymoron!"
> > This is, after all, going to be the first thing I try and put on CPAN.
> >
> > D
> >
> > On Thu, Oct 30, 2008 at 5:08 PM, Michael Graham <magog at the-wire.com>
> > wrote:
> >
> > >
> > >
> > > You have my blessing for anything you steal. I know you're going
> > > for 100% compatibility, but it might be a good project for doing
> > > some refactoring of some of the rough edges in cgiapp...
> > >
> > >
> > > Michael
> > >
> > >
> > > On Thu, 30 Oct 2008 15:21:17 -0400
> > > "Dave Doyle" <dave.s.doyle at gmail.com> wrote:
> > >
> > > > Well... despite my message asking about the meeting it looks like
> > > > I'll be unable to attend tonight.
> > > >
> > > > However, if we're running into a shortage of talks, I can
> > > > volunteer to put something together about Moose for next month or
> > > > whenever after. After my lightening talk and continued hacking
> > > > on Moose::CAP I've learned a lot more (and realized some stupid
> > > > mistakes in what I was doing) and can probably help others get a
> > > > start on things.
> > > >
> > > > I can also do more on what I've done with Moose::CAP. I've
> > > > actually applied for a PAUSE id to upload it to CPAN. I've
> > > > actually renamed it Sanguine (provided the PAUSE admins accept me
> > > > and approve the new namespace). I've also incorporated
> > > > CGI::Application::Plugin::Forward (sorry for stealing Michael...
> > > > but I give credit!), CGI::Application::Plugin::Redirect (I'm not
> > > > sure if Cees is on here... but I've stolen from him in other
> > > > places too) as well as incorporated a stash and TT. I've also
> > > > ported:
> > > >
> > > > CGI::Application::Plugin::DBH
> > > > CGI::Application::Plugin::Session
> > > > CGI::Application::Plugin::ValidateRM
> > > > CGI::Application::Plugin::FillInForm
> > > >
> > > > to Moose roles using different patterns depending on the needs of
> > > > the plugin which could be of interest.
> > > >
> > > > So if any of that sounds of interest, let me know.
> > > >
> > > > Thanks,
> > > > Dave
> > > >
> > >
> > >
> > > --
> > > Michael Graham <magog at the-wire.com>
> > >
> >
> >
> >
>
>
> --
> Michael Graham <magog at the-wire.com>
>
--
dave.s.doyle at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20081031/85434186/attachment-0001.html>
More information about the toronto-pm
mailing list