in my application startup process i have several tasks to perform until the application can fully run.
first it starts to load some config-XMLs, makes a couple of webservice calls and loads some libraries. all of this is done asynchronously to save time. when some of this tasks are finished i have to do some more and so on. so it turns out to be a quite compilcated flow-chart until startup is finished.
i have already sketched this graph down on paper to have a clear overview of whats going on.
currently this is implemented with lots of boolean variables and many if-statements. i assume this is obviously not the best way to do it, so my question is:
What design pattern is usually used for this kind of task? I thoughy of a state machine, but since there are so many possible states depending on which tasks finish first i end up with too many states for a state machine.