[dancer-users] Namespace for load_app modules

Yanick Champoux yanick at babyl.dyndns.org
Mon Dec 9 00:13:20 GMT 2013


On 13-12-08 06:41 PM, Henk van Oers wrote:
>
> WE want a namespace.

Acme::* ?

Only jesting, only jesting... Okay, let's try this again from the top.

If you wish to publish a full-fledged application, which the 
Amsterdam.pm seems to be, then what I would consider the right place is 
App::Amsterdam. Sawyer was right when he was saying that CPAN is 
historically not tailor-suited for applications, and so far I think the 
App::* namespace is the closest we have of a place for packaged up 
end-applications.

This being said, I would *strongly* argue that App::Amsterdam should not 
be pushed to CPAN in its current form. This is a very specific website 
that can't be reused as part of something else, or really used as-is by 
anybody but you.

On the other hand, if you want to morcel and publish pieces of the 
Amsterdam app that could be reused (a forum controller, a mailing list 
interface, etc), then the typical way nowaday is to package that into a, 
e.g., Dancer::Plugin::Forum module.

Now, it is true that Dancer has that concept of sub-apps that can be 
used via 'load_app'. I have yet to see somebody package functionality 
leveraging this mechanism instead of the plugin infrastructure, but I 
can see that it's totally possible -- and now that you have mentioned 
it, I'm intrigued. But, closer to the point, if you do have something 
that you can't wrap as a plugin -- and for the moment it seems this is 
not the case -- then as mentioned before Dancer::App::* is an iffy 
namespace, just because of the way we have layed out the design so far. 
If you do really have something that will make more sense to package as 
a sub-app, then dams's suggestion of using Dancer::Component::* would be 
the sanest way to go.

So, to recap:

full application? App::Stuff

Add-on to Dancer to make it more awesome? Dancer::Plugin::Stuff

Brand new concept that can't be wrapped in a plugin? Perhaps 
Dancer::Component::Stuff. But I strongly suggest that you bounce the 
code in here, as I'm pretty sure we can help you to coax that strange 
mutant into a more mundane plugin.


Joy,
`/anick


More information about the dancer-users mailing list