I usually use two services to solve this problem. First I create a service
that takes a string and returns an object. In your case I'd build a License
interface and the objects would all implement License. Most likely this can
be done with a service that takes a mapped configuration of String/Class<?
extends License>

Then I would use a strategy service to actually do the work by passing in
the class. This service can be used by the previous service so the
Generator service just takes a string and returns the license interface.

On Friday, May 6, 2016, Rafael Bugajewski <raf...@juicycocktail.com> wrote:

> Hello,
>
> I use tapestry-ioc in a Jersey JAX-RS application to access my Tapestry
> services. I have a LicenseService that generates a software license with
> the help of another service. This LicenseGeneratorService has
> implementations for different products Product1LicenseGeneratorServiceImpl,
> Product2LicenseGeneratorServiceImpl, ….
>
> Based on a String input parameter I want tapestry-ioc to let the
> LicenseServiceImpl use the correct LicenseGeneratorService implementation.
>
> What’s the cleanest way / pattern to approach this problem with the help
> of tapestry-ioc?
>
> Best,
> Rafael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> <javascript:;>
> For additional commands, e-mail: users-h...@tapestry.apache.org
> <javascript:;>
>
>

Reply via email to