Hans Dieter Pearcey
2009-08-31 23:49:35 UTC
rjbs mentioned this combination tonight, and I thought I would brainstorm:
1) parameter validation (the really obvious one)
<%args>
$foo => Str
@baz => ArrayRef[DateTime]
$quux # implicit Any
</%args>
I'd assume coerce => 1 here -- I can't think of any way of turning it off
gracefully, but I've also never wanted to. Dunno.
2) roles, somehow?
Magic pixie dust! I don't know, I just know I frequently want reuse that
autohandler doesn't work for.
The most common use of autohandler is like having a method that does this:
sub CONTENT {
$m->comp('/header');
inner;
$m->comp('footer');
}
The problem is that this inner/augment pattern is completely orthogonal to
almost every other kind of code reuse I find myself wanting to do with
components, which has more to do with e.g. /foo/bar in one comp root overriding
/foo/bar in another, while still getting the same autohandler-wrapping that it
would normally get.
I'm not sure yet how Moose would help with this at all.
hdp.
1) parameter validation (the really obvious one)
<%args>
$foo => Str
@baz => ArrayRef[DateTime]
$quux # implicit Any
</%args>
I'd assume coerce => 1 here -- I can't think of any way of turning it off
gracefully, but I've also never wanted to. Dunno.
2) roles, somehow?
Magic pixie dust! I don't know, I just know I frequently want reuse that
autohandler doesn't work for.
The most common use of autohandler is like having a method that does this:
sub CONTENT {
$m->comp('/header');
inner;
$m->comp('footer');
}
The problem is that this inner/augment pattern is completely orthogonal to
almost every other kind of code reuse I find myself wanting to do with
components, which has more to do with e.g. /foo/bar in one comp root overriding
/foo/bar in another, while still getting the same autohandler-wrapping that it
would normally get.
I'm not sure yet how Moose would help with this at all.
hdp.