Hello,
I am a newbie with Guice, so please excuse my shallow understanding...
To illustrate my use case, I have an implementation of an interface as
below:
public class DefaultCIService implements CIService {
@Override
public <T extends CommonUpdatableEntity> Long add(T entity) throws
CIServiceException {
// TODO Implement!
return null;
}
//.. omitted
}
Based on the actual instance's Type above (any extensions of
CommonUpdatableEntity - Human, Animal), I would like to choose an
underlying Store implementation (ex: HumanStore for Human, AnimalStore
for Animal etc) to persist it. Here's what the Store looks like:
public interface Store<T extends CommonUpdatableEntity, Q extends
Query<T>> {
public T save(T entity) throws StoreException;
}
So, when DefaultCIService#add(human:Human) is invoked, I want to
choose HumanStore. What is the best way to do it with Guice? I suspect
I would need to use Guice APIs - is that a bad thing?
Appreciate all pointers.
Cheers,
Rahul
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---