Johan and Davor, thank you for the reply!

Actually I have a application configuration which is stored in the
database, every time service is instantiated, builder service injects
value of the symbols inside the new service instance. I have expected
that symbol values will be refreshed (re-resolved) every time they are
needed, but obviously they aren't.
The idea behind is simplified testing, say we have a service Notifier
and it requires SMTP server address, we can implement a service
Configuration with Configuration.getSMTPServer() method that will be
injected into NotifierImpl and will be triggered when SMTP server
address is required. It will work but testing of the Notifier
implementation will require additional mock - Configuration mock, and
this mock will be olny there because of one method call.
I've changed implementation of the Notification service that in
constructor it accepts a string with SMTP server address and Builder
service injects directly string into the service, which simplify the
configuration and testing in the end. But since symbols are resolved
only once it is not working :(
In theory I can redo all my changes to inject configuration service
instead of individual values and change all unit tests, but I really
liked the idea about injecting values instead of services therefore
I'm thinking about changing/extending Builder service.

What do you think about it?

Renat



On 30/05/07, Johan Lindquist <[EMAIL PROTECTED]> wrote:
Hi All,

Davor is indeed correct - the registry is created once and is from that
moment "read-only".

Cheers,

Johan

Davor Hrg wrote:
> I think hivemind is inteded for startup only,
> symbols and configurations are not supposed to change,
>
> maybe you could tell us what are you trying to achieve.
>
> if you want dynamic data you should create a service that provides it and
> read data from that service.
>
> Davor Hrg
>
> On 5/30/07, *Renat Zubairov* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> > wrote:
>
>     Hello,
>
>     I've used hivemind symbols extensively in my application, but recently
>     discovered a strange bug (feature).
>     It seems that even so my services are threaded and my symbolsource is
>     threaded service from where symbolsource is reading symbol values is
>     threaded, symbol values once red are not refreshed. Or may be other
>     way, they seems to be red only during initialization time.
>     Is it should be like that? So symbols are "statitic"?
>
>     Is there any other similar mechanism to achieve the same but with more
>     dynamic symbols?
>
>     --
>     Best regards,
>     Renat Zubairov
>
>

--
you too?



--
Best regards,
Renat Zubairov

Reply via email to