A workaround it to use providers for @OfflineDatabase. A bit clumsy
but it works.
The good part is that I don't need @LiveDatabase annotation and main
module is not affected by its offline version.
http://pastie.org/1001680

Maybe I have a design issue? Anyone have a better idea?

Octavian

On Jun 9, 6:16 pm, Octavian <[email protected]> wrote:
> Hi,
>
> I'm studying now Guice and have some trouble understanding private
> modules. From example withrobotlegs I found how to initialize
> similar trees of objects with different configuration but my concrete
> case pushed me further.
>
> I have an application with a lot of services that work with live
> database. In case of internet connection drops, the application
> detects it and switches to services that work with offline database.
> Out of N services, only 2-3 work with offline database. I found a way
> to do this with annotation bindings but I feel somewhat uncomfortable.
> I have to inject my services with @LiveDatabase annotation for normal
> use, and @OfflineDatabase for offline services. Is there a way to
> inject my services for normal use without annotation, and for remote
> with annotation?
>
> I tried to bind and expose services without annotation, but this does
> not work...
>
> My testng case here:http://pastie.org/997886
>
> Thank you very much!
>
> Octavian

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to