You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter V <pe...@yahoo.com> on 2007/05/05 19:18:29 UTC

Some thoughts on T5

1. Activation context

Handling contexts, where some parameters are optional
is problematic. Example - we have a search page with 2
parameters: a name and a job and we want to make
search results bookmarkable. So to find every Joe who
works as an engineer url could be constructed this
way: ../search/Joe/engineer. So far so good. But if we
want to search only by a name or only by a job? We
must put additional information into a URL, example
.../search/job=engineer or ../search/job/engineer. I
think that standard query parameters would be better
idea here, but AFAIK you can't construct such a URL in
onPassivate().

Second example - a page for displaying some product
statistics in given cities. So a request
.../displaystats/10/Miami/Tokio/Paris could show
statisticts of product with PK=10 in above 3 cities.
Current T5 snapshot restrics us to something like:

onActivate(Integer productId, Object[] o)

but product PK will be present both as an productId
and first object in o array and we can't use just
String[] as a second parameter to get only cities. It
would be nice to have a smart way to handle such
scenario by:

onActivate(Integer productId, String[] cities)



2. Disadvantage of 2-phase (action/render) request

- overhead of a second request
- a database interaction is more complicated because
one (from user POV) request will spawn 2 requests and
2 transactions (when session-per-request is involved).
So request isn't 'database atomical' anymore. I
suppose that the transaction on render request will be
usually read only, but...
- to pass objects between an action request and render
a request a session (via @Persist) must be used.
Activation/passivation mechanism is stateless but
a) must be explicity written by developer
b) passing entities like Product by its primary key
may need additional roundtrip to database (to recreate
entity from PK) or... DataSqueezer?

P.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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