It useful for library modules because you can build a set of pages,
components and classes that work on Interfaces instead of concrete classes.
The application can just implement the interfaces and contribute them. In
my case about I have an Invoice interface that's is defined in a shop
module. The shop module just operates on the Interface. Then I have a web
app that implements that Interface in my case as a DynamoDB object. Others
could implement it as a JPA or Hibernate object.

There are several reasons it needs to be in the core.

1. It would be great if BeanEditForm used it so  BeanEditForm could work
with interfaces.
2. If you are going to build a Modules based on Interfaces it needs to be
in the core otherwise everyone will end up with a different implementation
and they don't interoperate.
3. It's easier to use in pages/components than locator.
4. Tapestry is really good about using Interfaces to define functionality
but it's difficult to do this in modules that define components. This
solves most of the problems.


On Fri, Sep 27, 2013 at 3:49 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 27 Sep 2013 16:39:14 -0300, Barry Books <trs...@gmail.com> 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.**
> constructComponentEventResultP**rocessor().
>
> 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: 
> dev-unsubscribe@tapestry.**apache.org<dev-unsubscr...@tapestry.apache.org>
> For additional commands, e-mail: dev-h...@tapestry.apache.org
>
>

Reply via email to