[Catalyst] Project Name
Matt S Trout
dbix-class at trout.me.uk
Wed May 10 01:22:21 CEST 2006
Nathan Kurz wrote:
> On Wed, May 03, 2006 at 07:42:59AM -0500, Bryan Roach wrote:
>> I have a little question that's been bothering me. Why is it that the
>> name of a Catalyst project is used repeatedly? Many file names and
>> folder names include the project name, and every .pm file uses the
>> project name one or more times. If I ever want to rename a project,
>> it's going to be rather tedious. And if I want to copy a Model (for
>> example) from one project to another, I'd have to edit each file to
>> update the project name in multiple places. This isn't a huge deal,
>> but it would be nice to understand the reasoning behind it.
>
> I thought this was a great question, and though there were some
> responses, they didn't really deal with the problem head on: how does
> one design Catalyst modules that can be reused without hand-editing?
>
> The best solution I can come up with is just to avoid specific names:
> name all projects "App" and avoid package naming conflicts by
> presuming that everything will be run out of a local directory.
I've always found using a generic namespace for generic components and
then just creating an empty subclass of them works fine.
This is no different from how things like C::V::TT and
C::M::DBIC::Schema et. al. work.
> Is there a better solution? To make the question more concrete,
> presume (as I am) that I'm writing a simple signup/registration to be
> used as a sample app and base for others. How should I structure it?
>
> Ideally, I'd like it to be possible for people to untar it, test it,
> customize a configuration file to match their project name, and then
> start adding controllers without renaming and searching-and-replacing.
The above technique is good, really. Also means the generic stuff can be
in a separate distribution to the apps using it, so you can release
bugfixes to the generic stuff without people needing to copy stuff into
their app tree etc.
More information about the Catalyst
mailing list