I've been surprised to see that pattern a couple of times recently too.
Personally I like to use a different pattern. I see the context's
startup method as the "app entry point" for wiring purposes (which is
the same in any RL app I suppose). For any "on startup" actions such as
checking for updates, loading the initial data, etc. I have those
actions in one or more commands that are mapped to the
ContextEvent.STARTUP_COMPLETE event. You can trigger that event by
calling super.startup() in the context's startup() method. You can also
just manually dispatch the event at the end of your startup() method
(which is actually what I've always done because I only recently learned
that super.startup() dispatches that event).
P.S. on a related note, I see that the fact that those events are
dispatched isn't documented. I guess I may be adding something to my
fork of Robotlegs today =)
Each of these 'Config[...]Command' classes contains the actual
mappings for Model and Service, Controller and View respectively.
In my StartupCommand I call the actual first method to initialize
the application, in my case calling a 'load' method on an
I think Stray uses the word "Bootstrap" instead of "Config",
which is probably a better description, but somehow I don't like
the word. Bootstrap... Ugh. ;)
@Abel: Yes, I am also having something like you but I would like
to load XML files before kicking starting StartupCommand.
Currently, I am using the code below to solve this problem but I am
not happy with it:
As you can see it will continue with bootstrapping after
StatisticsServiceEvent.CREATED has been dispatched which creates
and options a specific SQLite database. All the event mappings
exists only once also I am having a StatisticsEvent.LOADED which
means a record has been read from the database.