Alejandro Imass wrote:
> Although I think there is no best practice as such, I mean there are
> many ways to do this in Perl in general, but Catalyst offers the nice
> feature of the main config file in YAML, so I keep all my constants
> and configuration values there.
> 
> YAML is so powerful that IMHO it's the best place not ony to store
> your constants but to structure them intelligently. Of course, all the
> constants you put in your YAML file will be vailable through
> $c->config->{foo}

I wouldn't put these constants in the applications main configuration
file unless the constants are for the application. Jarom's example
indicates the constants have to do with data coming from a model so I'd
put them in a package in the model's namespace.  That way MVC separation
is maintained *and* you have access to the constants outside the
catalyst app if needed.

--[Lance]


-- 
 GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9
 CACert.org Assurer

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to