or Create a profile
01 Jun, 2012 03:11 PM
In my application, there is Singleton class (AppUitls.as) which
reads config.xml and store value in local variables to access
within App from anywhere.
On application context startup() I mapped AppUtils class as
singleton. But as File read operation is Event based (FileStream),
the other injected classes get initialized before FileStream's
Event.COMPLETE event fires and my other class constructor uses
variables from AppUitls.as class for initialization. And
application fails as null values are there in AppUtils class
Am I doing anything wrong? Or there is a way to first let the
files IO operation to complete and then start injecting other
2 Posted by neil on 01 Jun, 2012 03:29 PM
What I tend to do is to remove mappings from the context and
you can then split you bootstrap into phases.
in the context inject your AppUitls ( which shall we say
dispatched a COMPLETE event )
then map your Mapping commands to fire on
being me, I also tend to hook all this into an FSM that manages
progression through the Bootstrap sequence, so you can sequence
your dependencies nicely.
3 Posted by pingale.indrajit on 02 Jun, 2012 05:32 PM
Thanks Neil. You are right. This is the only solution for my
pingale.indrajit closed this discussion
on 02 Jun, 2012 05:32 PM.
Comments are currently closed for this discussion.
You can start a new one.
2 people watching.
No more actions from Robotlegs or the discussion starter are required.
This discussion is private.
Only you and Robotlegs support staff can see and reply to it.
This discussion is public. Everyone can see and reply to it.
Powered by Tender™.