Hi,
I am new to guice and trying to explore on how to use it in my
project. I have the following use case:
1) interface IFetcher { void fetch(); }
2) Multiple implementation:
class StreamFetcher implements IFetcher { void fetch(){} }
class MemoryFetcher implements IFetcher { void fetch(){} }
class DBFetcher implements IFetcher { void fetch(){} }
..... There are around 6-7 types.
3) class FetchRecord {
private FetchType fetchType;
// ... data
public getType(){
return fetchType;
}
}
4) Have a fetcherCaller
class InvokeFetcher {
private EnumMap<FetchType, IFetcher> fetcherMap;
public fetch(FetchRecord record) {
fetcherMap.get(record.getType).fetch();
}
}
Currently I have modeled this using spring ioc. Could anyone guide me
on how to achieve this using guice?
Thanks in advance!
--
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.