On Tue, Aug 14, 2012 at 5:49 PM, Dave Kincaid <
kincai...@gmail.com> wrote:
> So I'm wondering how others handle this. In one project recently I setup a
> global map using ^:dynamic and then switched in the appropriate map from a
> command line argument. This somehow doesn't seem the right way to do it. Any
> suggestions? Are there some projects out there that would be good examples
> of this?
At World Singles, environment control was one of the first things we
switched over to Clojure.
Essentially we have a map of maps - a map with default settings and
then a map for each environment with overrides - and a settings Var
that is a delay of creating the merged map for the current host (by
looking up the local hostname in the override maps). That's a gross
simplification but it should give you an idea of what we're doing.
The application just accesses @worldsingles.environment/settings and
it's created on first access and cached for subsequent access (because
of delay).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View --
http://corfield.org/
World Singles, LLC. --
http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)