I dont see any ugly in employing observer pattern between 1 to x-1 modules. 1 observes 2, 2 observes 3 and x-1 observes x. if x files x-1 will roll off and raise fail event which will let x-2 know. only thing you need to make sure that you wont end up with circular reference.
Aug 13, 2012
Your scenario is a perfect workflow enclosed withing atomic transacation scope - All Suceeds or All fail..
Take a look at Windows work flow foundation, which gives you clear idea to handle your scenario.
The module dependency here , I presume it is somthing similar to business rules,,
If you have a configurable way of defining a module's dependency, which could be read and work flow built within an atomic transaction scope, you are almost done.
From your statement, it is not clear how do you plan to add/remove modules , which should be always fore thought , to handle scalability /maintainability point of view.
Hope this helps.
Thanks & Regards
Tarriq Ferrose Khan, Aug 13, 2012