You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Erik Fäßler <er...@uni-jena.de> on 2012/01/30 16:56:42 UTC

Using Tapestry-IoC libraries in non-Tapestry application

Hello all,

I was wondering whether it is possible to build a JAR library which uses Tapestry-IoC internally which is then used by another application without being aware of Tapestry at all.

The reason is that we already use a framework architecture for NLP related processing (UIMA). This framework defines components - annotators - which can be put in line flexibly to create a variety of different pipeline architectures, reusing the same components.

One of our components has grown quite big and I feel Tapestry's service and IoC mechanisms would work just fine here. The UIMA framework, however, does not use any external IoC container, AFAIK. Thus, my bigger components for which I would like to use Tapestry IoC would do so silently.

But I should not use multiple registry objects if I'm correct. But I also don't have a main application to hold the registry - this would be the UIMA Framework itself which I'd rather not alter for this purpose. Is it perhaps possible to create one central registry which can be used by all UIMA components? I could use a static class with a static registry variable, for example. By Tapestry's module-autoloading, all modules should be included in this central registry. But I don't know if I don't just run straight into bigger problems with that approach. So I'd like to ask for your advice.

Thanks and best regards,

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


Re: Using Tapestry-IoC libraries in non-Tapestry application

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 30 Jan 2012 13:56:42 -0200, Erik Fäßler  
<er...@uni-jena.de> wrote:

> Hello all,

Hi!

> I was wondering whether it is possible to build a JAR library which uses  
> Tapestry-IoC internally which is then used by another application  
> without being aware of Tapestry at all.

Short answer: yes.
Long answer: yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeesss! Tapestry-IoC is  
completely independent from Tapestry-core (the web framework). You'll just  
need to get the Registry instance yourself, but it's easy and documented  
here: http://tapestry.apache.org/starting-the-ioc-registry.html.

> But I should not use multiple registry objects if I'm correct. But I  
> also don't have a main application to hold the registry - this would be  
> the UIMA Framework itself which I'd rather not alter for this purpose.  
> Is it perhaps possible to create one central registry which can be used  
> by all UIMA components? I could use a static class with a static  
> registry variable, for example. By Tapestry's module-autoloading, all  
> modules should be included in this central registry. But I don't know if  
> I don't just run straight into bigger problems with that approach. So  
> I'd like to ask for your advice.

I can't see any problems with your approach.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Using Tapestry-IoC libraries in non-Tapestry application

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 31 Jan 2012 15:31:33 -0200, Andreas Fink  
<fi...@googlemail.com> wrote:

> Hi Erik.

Hi!

> Be aware of the fact that many classes you will use through T5 will be  
> rewritten. So if your "wrapping" application needs to work on  
> annotations, make sure those are on interfaces, not implementing classes.

You can file a JIRA for Tapestry-IoC supporting annotations in classes.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Using Tapestry-IoC libraries in non-Tapestry application

Posted by Andreas Fink <fi...@googlemail.com>.
Hi Erik.

Be aware of the fact that many classes you will use through T5 will be rewritten.
So if your "wrapping" application needs to work on annotations, make sure those are on interfaces, not implementing classes.

Cheers,
Andi.

On Jan 30, 2012, at 16:56 , Erik Fäßler wrote:

> Hello all,
> 
> I was wondering whether it is possible to build a JAR library which uses Tapestry-IoC internally which is then used by another application without being aware of Tapestry at all.
> 
> The reason is that we already use a framework architecture for NLP related processing (UIMA). This framework defines components - annotators - which can be put in line flexibly to create a variety of different pipeline architectures, reusing the same components.
> 
> One of our components has grown quite big and I feel Tapestry's service and IoC mechanisms would work just fine here. The UIMA framework, however, does not use any external IoC container, AFAIK. Thus, my bigger components for which I would like to use Tapestry IoC would do so silently.
> 
> But I should not use multiple registry objects if I'm correct. But I also don't have a main application to hold the registry - this would be the UIMA Framework itself which I'd rather not alter for this purpose. Is it perhaps possible to create one central registry which can be used by all UIMA components? I could use a static class with a static registry variable, for example. By Tapestry's module-autoloading, all modules should be included in this central registry. But I don't know if I don't just run straight into bigger problems with that approach. So I'd like to ask for your advice.
> 
> Thanks and best regards,
> 
> Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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