You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Byrne, Steven" <SB...@dorado.com> on 2003/11/03 20:59:15 UTC

Tapestry Library usage

I'm looking at leveraging Tapestry's library concept, and I have some
questions for the wise people on this list.
 
Basic scenario:
The application that I'm working on has several large grained modules to
it.  These modules each have their own set of pages and page flows,
along with distinct business logic and persistent store (these last two
aren't relevant and I mention them just for completeness).  The modules
can be aggregated together at runtime, but depending on customer choice,
some modules may not be present, and others may be added to an existing
system.  The modules will be able to leverage shared component and
validation mechanisms.  The coupling between the modules is ideally
zero, although there may be cases where one module might like to detect
the existence of another and possibly page flows transition between
modules, but this last point is a "nice to have".
 
Tapestry's library facility seems like it's a good fit for this: it
defines an encapsulation boundary for a set of Tapestry components and
pages, along with the corresponding Java code.  It allows a set of
meta-data annotations to be placed on the library to make the library
self describing to a higher level detection/location/aggregation
mechanism.
 
Questions:
1) is this a reasonable way to use libraries?  I.e. not just components
but having a disjoint set of pages contained in the library?
 
2) How should references to pages in the library be made?  I.e. there
will be a need for the top level application to allow navigation into
the libraries based on the user's input, but how should these pages be
referenced?  I know I can use libraryid:pagename and maybe that's ok,
but I'm wondering if there is a way to hide the usage of the libraryid,
via some aliasing mechanism or something.  If one module wants to
transfer control into another module, it's not going to easily know what
library id was chosen at the application level for the target library,
so it would be nice if that could be decoupled a little bit
 
3) Is there an easy way to support "subroutine" type page flows?  I.e.
the top level application allows the user to navigate into a particular
module (library)'s entry page, then the user navigates through a wizard
like page flow that's present in the library, and then at the end of the
module's page flow, control returns to the caller's "next" page?  I can
think of passing a "return page" name via a visit or something like that
that the library can refer to when it wants to return, but I am
wondering if there are more sophisticated mechanisms available for use.
 
4) is there a standard way to detect the presesence of a specific
library at runtime?  I can envision getting a hold of the application
servlet, and from there finding all the libraries that are a part of the
application, but maybe there is a more direct mechanism that I don't
know about?
 
5) Are library name spaces distinct?  I.e. do I have to worry about
using the same page/component/Java class name in different libraries?  I
think the answer is no, but I'd like to be sure.
 
Thanks for any help you can provide!
 
Steve