Something similar to Guice modules will be coming soon, but that's not really what I meant. What you see often in Spring projects is things like database connection information mixed in with the bean definitions, which while you can get away with it in Spring because the bean definitions are parsed at run time rather than being compiled, it really grinds my gears :)
My philosophy is to define the app structure itself in rules via ActionScript, and anything that would vary from server to server (in our case it's mainly WSDL urls) we put into a config.xml file, which is served from the same location as the SWF.
There's nothing particularly clever in our config file decoder, it's about a page of code. At Pathways I built a fairly extensive application framework that sits atop SmartyPants-IOC, and as part of the bootstrap lifecycle it just instantiates a Config("config.xml"), and then inspects the parsed info, creating rules to bind the values as Strings.
A config name/value pair of
<param name="wsdl" value="
http://server.com/main.wsdl"/>
becomes SmartyPants.whenAskedFor(String).named("config::wsdl").useValue("
http://server.com/main.wsdl");
-Josh
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
Josh 'G-Funk' McDonald
-
jo...@joshmcdonald.info
-
http://twitter.com/sophistifunk -
http://flex.joshmcdonald.info/