Re: AW: Circular dependencies

Niclas Hedhman <[email protected]> Tue, 5 Oct 2004 19:44:44 +0800
Newsgroups gmane.comp.jakarta.avalon.user
Organization Private
Message-ID <[email protected]>
On Tuesday 05 October 2004 14:32, Jan Schröter wrote:

> The problem results from a central component that acts as a surveillance
> service for the other components. These components should be able to access
> the surveillance service to pass information to it but also the service
> should be able to query the individual components about their status. 

This is not the description of a circular structural dependency.

Let's say I have a service called Gadget, which are the pieces that you can 
query and stuff.

The Gadget implementations dependsOn the SurveillanceService.

Each Gadget looks up the SurveillanceService and calls a method in the 
SurveillanceService, where it 'registers' itself, for instance done in the 
initialize() method of the gadget;

And at dispose(), the Gadget deregisters themself in the SuveillanceService.

This strategy will allow you to add Gadget's in runtime without re-compiling 
Surveillance implementation or even shutting down Merlin/Metro !


If you don't follow, please feel free to ask some more.


Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+