1

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.

clamp
  • 33,000
  • 75
  • 203
  • 299
  • Sounds like a *business process engine* to me (the business is rather technical, though). – Andy Jan 02 '13 at 14:46
  • 1
    Command Pattern + Observer Pattern. [Look at this similar question](http://stackoverflow.com/questions/8951276/callback-command-vs-eventlistener-observer-pattern) – user1168577 Jan 03 '13 at 07:08

0 Answers0