On Fri, 27 Sep 2013 16:39:14 -0300, Barry Books <[email protected]> wrote:

I don't think so. In my case the value passed to the build method is always type Class and the return is a new object based on the class type.

In StrategyBuilder/StrategyRegistry's case, the parameter is always Class. You could implement your proposed service using StrategyBuilder, which just doesn't do the service instantiation you want.

As an example, you can look at TapestryModule.constructComponentEventResultProcessor().

What's the use case? Having entity classes injected with services? Just curious. :)

The strategy builder service takes a set of services and constructs a new
service that directs calls by the object type of the parameters. You can't use it for this purpose because in this case the parameter type is always
the same i.e. Class

In the StrategyBuilder case, the key is always a Class instance: the registered Map is <Class, T>, where T is any type you want, but the key is always Class.

--
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to