communication between modules problem

Topics: CAB & Smart Client Software Factory
Dec 20, 2006 at 10:41 PM
originally posted by: pariv

I have, for example, two modules. First module managing objects, Workers... Second module managing Orders not only for workers. They can work without each other, and Orders module can work with other modules. When I loading Orders module, it adding his menuItems to all other loaded modules menus which this Orders module support. And now I want to execute command when I click on that menuItem, but problem is how I can send to Orders module an object (Worker in my example) which is selected when I pressing button...
I cant publich events in Worker module, cause that module dont know about any other modules and about that menu item which wil be added by Orders module... Or may be I missing something...

Any ideas?
Dec 21, 2006 at 2:59 PM
originally posted by: bil_simser

Two things. First, you can use the State attribute which will allow you to share say a Order with any other module. Second I don't know why you say you can't publsh events in your Worker module. The entire publish/subscribe system is based on the framework so it handles getting the messages and publishing them to anyone who wants to consume them. Your Worker module doesn't need to know about it, it just publishes what it wants to a holding area where another module will come along and consume it.
Dec 21, 2006 at 9:54 PM
originally posted by: pariv

About events. For example: If I have menuItem in Workers menu, which added by Orders module, what kind of event I should publish is Workers module for handling click on that menuItem? Workers module doesn't know about any other menuItems that can be there, that why I said that I cant publish event in Workers module (its how it is in my mind).
About State. To communicate between modules with State I will need to save that State in RootWorkitem... I have large application (in project) and many modules, and if every module will save his States (not all of course, but almost all) in RootWorkitem I dont think its right idea... (may be Im wrong, but its how I see it)