Question on Design

Topics: CAB & Smart Client Software Factory
Jan 2, 2007 at 9:59 PM
Let say I have two modules A and B. Module B has many functions and one of the functions is to do data entry. In order to make the entries accessible, I created a service in module B using ServiceDependency attribute in the presenter so that the service is created when the presented is constructed.

My question is how to access this service in module A ???


Thanks
nativecpp
Jan 3, 2007 at 8:07 AM
You have to publish the service in the RootWorkItem.

Or we have to request for a hierarchical module loader that can provide a different work item for the descendent modules. This way we could couple modules that are isolated from the rest. We could even load several instances of the same module each in a different context.
Jan 3, 2007 at 12:46 PM
The Infrastructure.Module is designed for this. It's a module loaded up by the Shell and setup in the config file under "Services". You could just add your service to it then all other modules would require it and the loader would ensure it's loaded and ready to go when they need it.
Jan 3, 2007 at 4:33 PM
To PauloMorgado and bsimser,

I am relatively new in this area. Can any of you give some sample code or links ?

Note that since dataentry is one of the functions of Module B, it is therefore possible that the service does NOT exist yet as the user hasn't open a grid.

Thanks
nativecpp