Hi,
Our whole project uses hand-written DI and I really want to switch to
Guice.
Here's something we have and I would like to understand how it's done
with Guice.
we have a factory method, that based on an input string, returns a
specific implementation of an Abstract Factory:
public class TypeFactoryCreator {
public static AggregationStrategyHolder
createStrategyHolder(IConfiguration configuration, Date toDate) {
switch (enum based on a string) {
...
}
AggregationStrategyHolder has two members (strategy and abstract
factory):
public class AggregationStrategyHolder {
private final AggregationStrategy aggregationStrategy;
private final AggregationFactory aggregationFactory;
...
}
So, the factory method builds the strategy and AggregationFactory
based on input string.
AggregationFactory is an Abstract Factory design pattern.
So I think that my question should be, how to bind different classes
according to runtime input?
Was I clear ? :)
Thanks
Eyal
--
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.