You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by josete <mu...@gmail.com> on 2011/10/06 16:24:39 UTC

Tapestry and CDI ( the need for )

Hi guys !

I do need some behaviour in Tapestry already available to me via CDI in a
non-web Application.

Let me explain myself :

I have a product, made for different customers.

The product is the same, but for some different implementations of common
services each one has.

For example :


com.mycompany.product.service.customer1.SubscribeService
com.mycompany.product.service.customer2.SubscribeService
com.mycompany.product.service.customer3.SubscribeService


In CDI ( Using weld ), y do use the beans.xml file facility to populate the
service for the desired customer.
Then, in the code all i need is invoking the @Inject into a service, and i
will get the customer X service  at my disposal.

But in Tapestry, i do not know how to implement this.

I believe that dinamically adding a service to  the  public static void
bind(ServiceBinder binder) in the AppModule is not the wright way to achieve
it.
   

May any of you help me with this ? I do not need any runtime behaviour, just
compile time.

Thanks everyone, and long life to Tapestry ! ( So to Howard and all the
maintainers, of course  :) )

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-and-CDI-the-need-for-tp4876507p4876507.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Help on Tapestry and CDI ( the need for )

Posted by josete <mu...@gmail.com>.
No, wrong path .. any help ?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-and-CDI-the-need-for-tp4876507p4876655.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry and CDI ( the need for )

Posted by josete <mu...@gmail.com>.
Uhm .. looks like i can use 

https://cwiki.apache.org/confluence/display/TAPESTRY/Configuration#Configuration-SettingExecutionModes
Configuration-SettingExecutionModes 

Let's check .. any better idea ?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-and-CDI-the-need-for-tp4876507p4876576.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry and CDI ( the need for )

Posted by josete <mu...@gmail.com>.
Uhm .. yes, that may add complexity to the build-process but will keep
tapestry cleaner.

I'll try that, thanks.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-and-CDI-the-need-for-tp4876507p4877038.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry and CDI ( the need for )

Posted by Giulio Micali <gi...@gmail.com>.
you said that you know which service you should use at compilation time ?

you can create 1 module for the interface and 3 separate modules (aka
component library) one for each implementation (and contribution) and
include one of them in your build conditionally(for example, with maven or
ant or gradle).

In this way, you develop only the first time and you can use there modules
in many webapp.

I hope that helps.


2011/10/6 josete <mu...@gmail.com>

> Thanks thiago, but that's not ideal for me, as i do not know at runtime
> which
> module i will use.
>
> My ideal is to bind the service at compilation time, and i think i've found
> the solution in my previous posts, just by defining a system property of
> -Dtapestry.execution-mode=customer1.
>
> That way, the system will @inject the customer1 app module, with itself,
> defines the desired customer1 behaviour.
>
> By using the registry, i think i'm doing 2-3 more steps than just using the
> tapestry.execution variable.
>
> Is there a way to handle this without the tapestry.execution logic ?
>
> Thanks !
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Tapestry-and-CDI-the-need-for-tp4876507p4876947.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Tapestry and CDI ( the need for )

Posted by josete <mu...@gmail.com>.
Thanks thiago, but that's not ideal for me, as i do not know at runtime which
module i will use.

My ideal is to bind the service at compilation time, and i think i've found
the solution in my previous posts, just by defining a system property of
-Dtapestry.execution-mode=customer1.

That way, the system will @inject the customer1 app module, with itself,
defines the desired customer1 behaviour.

By using the registry, i think i'm doing 2-3 more steps than just using the
tapestry.execution variable.

Is there a way to handle this without the tapestry.execution logic ?

Thanks !



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-and-CDI-the-need-for-tp4876507p4876947.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org