[Catalyst] Config-only components
Todd Harris
todd at tharris.org
Thu Feb 14 04:30:15 GMT 2008
On Feb 12, 2008, at 12:09 AM, Dagfinn Ilmari Mannsåker wrote:
> Hi all,
>
> Castaway mentioned the idea of having components defined entirely by
> config entries, without the need for any actual class files on disk,
> and
> I was bored, so I went ahead and implemented it.
>
> For each config key matching ^([MVC]|Model|View|Controller):: it
> checks
> if the corresponding component already exists, and if it doesn't it
> creates it on the fly. The base class is set to
> ->config->{$component}->{base_class} if it exists, Catalyst::
> $component
> (with [MVC] expanded to the full component type) otherwise.
>
> Here's the patch against 5.70/trunk, feedback welcome.
<snip>
Looks interesting. I'm dynamically registering a large number of
actions based on configuration entries. This is a great
simplification, but also seems like a bit of a hack. I'm overriding
render_actions() to accomplish this.
I just took a cursory look at your patch. It doesn't handle seeding
dynamically registered actions with coderefs, it's just intended to
create the appropriate components, correct?
Todd
More information about the Catalyst
mailing list