You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Scyta1e <ch...@uzza.net> on 2009/08/24 16:47:47 UTC
T5 Pluggable Pages
I'm currently in the process of porting an application from T4->T5 and have
run into a problem.
Specifically the application has 100+ pluggable modules. Each module has
it's own jar containing its specific classes and related Tapestry config
class/template. A custom class loader loads the modules once at startup
(it's not actually dynamic).
At runtime users may only have a handful of the available modules installed.
In T4 we used a combination of a custom SpecificationResolver to locate the
classes/pages in their respective packages and then simply accessed pages
using:
...
ModuleBasePage page = (ModuleBasePage)
cycle.getPage(module.getClass().getName()+"Config");
nextPage.setNextPage(null);
nextPage.setModule(module);
...
I understand in T5 everything has to be statically defined which I've found
much simpler, but it does appear to be a show stopper for me in porting this
modularised application to T5.
I don't belive I can follow the recomended practise of having a delegate
component and blocks per module because at runtime many programatically
defined instances will not available which will cause
a ClassNotFound exception.
Is there a solution/pattern in T5 for supporting this kind of modular
plugability? Specifically how can I solve:
a) locating pages stored in different packages
b) obtain an instance of the page, initialize it and use it?
Thanks in advance,
Chris
--
View this message in context: http://www.nabble.com/T5-Pluggable-Pages-tp25117404p25117404.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: T5 Pluggable Pages
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 24 Aug 2009 11:47:47 -0300, Scyta1e <ch...@uzza.net> escreveu:
> Specifically the application has 100+ pluggable modules. Each module has
> it's own jar containing its specific classes and related Tapestry config
> class/template. A custom class loader loads the modules once at startup
> (it's not actually dynamic).
If I correctly understood what you meant, Tapestry-IoC already does that
automatically:
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/autoload.html
> a) locating pages stored in different packages
Tapestry already does that:
http://tapestry.apache.org/tapestry5.1/cookbook/lib.html
> b) obtain an instance of the page, initialize it and use it?
Take a look at ComponentSource.getPage();
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org