[Config-loader] Scope of the project

Robert Krimen robertkrimen at gmail.com
Sun May 3 19:01:15 GMT 2009


On Sat, May 2, 2009 at 11:30 AM, Clinton Gormley <clint at traveljury.com>wrot=
e:

>
> This sounds right to me.
>
> i started writing some API ideas, and then my brain went pop over the
> details, as I was trying to nest various different loader 'types' eg
> file vs dir vs db vs env etc
>
> Later it occurred to me that it is much simpler than that: essentially a
> pipeline of 'actions' where an action might be:
>  - load from file X
>  - load all files in dir Y (including sub-dirs) and merge
>  - postprocess
>  - load local overrides etc
>
> All actions would be executed sequentially, rather than being nested.
> makes life much simpler :)


I see it as a pipeline as well.

1. Read from a source (Config::Any, Config::General, CodeRef, ...)
2. Merge based on weights (source importance) or custom algorithm
3. Filter, or postprocessing (do substitution, such as __path_to( ... )__ )

Right now, I'm thinking that local overrides and such should be the
responsibility of the source. What if
the source is a database? Path-style localization doesn't make much sense
there.


> Also, re ::Simple. If my thinking is correct, the ::Simple module
> wouldn't be required, as Config::Loader would do the right thing with
> the minimum of configuration.


Take t0m's point earlier in the thread. He wants a way for people to easily
use their Catalyst configuration outside of Catalyst.
Let's say that the Catalyst Config::Loader config looks something like this:

Config::Loader->new( ... 30 lines snipped (which ENVs to grab, etc) ... )

Does that mean people need to recreate those 30 lines in their app if they
want to access their Catalyst config? No, that's not very easy.

The easy way to do that would be:

# Catalyst::Config is built off of Config::Loader
my $config =3D Catalyst::Config->new( name =3D> $name, package =3D> $packag=
e ) #
You're done.

That's how I see the relationship between Config::Loader and
Config::Loader::Simple

At this point, I think Config::Loader::Simple would be a small wrapper
around Config::Any, but I'm not really sure

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/config-loader/attachments/20090503/=
37afecfb/attachment.htm


More information about the Config-loader mailing list