there's not really any specific place to put such configuration in
Robotlegs. I think people deal with this quite differently, so I'll
just state what I normally do:
The short version is: "in the application's override of
Context#startup" - the slightly longer version follows:
For small projects, I do all injector mappings directly in the
projects' override of Context#startup as can be seen in Joel's
FlickrImageGallery example and simply do the configuration mappings
before all other mappings so as to verify availability of the
configuration parameters to all services.
For bigger projects, I bind several specialized startup commands to
the ContextEvent.STARTUP event and make the first one a
ConfigurationCommand that creates all the injection mappings dealing
with application configuration.
Depending on what kind of configuration settings you have to apply,
you might either use if/ else clauses (e.g. to map the live or the
testing version of a service) or simply assign a value contained in a
variable to a mapping (e.g. to map a URL or an API key).
In most cases, you'll want to have access to the SWF's LoaderInfo or
at least to the ApplicationParameters to be able to even find out
which configuration to apply, so your startup method might look
protected override function startup() : void
// further startup command mappings here ...
That's what I'm using, at least - others might have different/ better recipes.
Hi Till, I have the same question as the original poster and am
not sure if your answer addresses it. So let me ask differently;
for instance, Parsley has these
ActionScript, MXML and XML configuration options where the
first 2 are used at compile time and the last one for runtime
Is there a similar option (some kind of textual config that can
be loaded at runtime) available in Robotlegs?