You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonathan Locke <jo...@muppetlabs.com> on 2004/04/18 01:09:45 UTC
page lifecycle
this framework and the "Tapestry in Action" book are TOTALLY dyn-o-mite!
thanks to everyone involved for (finally!) creating a truly worthwhile
framework for doing web UIs.
there are very few points of confusion in tapestry and really no fatal
flaws that i can perceive.
it's totally straightforward and component oriented in almost all aspects.
unfortunately, the component model doesn't quite go as far as i'd hoped
it would. pages *are* components. no doubt about that. but they are
kindof temporary components that do not have an object/component-like
meaning with respect to a session using the application. they appear
and disappear at a page-request level granularity. this makes it
necessary for developers to use all kinds of weird tricks like Hidden
fields and Visit/session state to work around issues having to do with
the browser back button. it makes more sense to me to consider all the
pages (or at least some reasonable number of recent pages... others can
expire) in the user's browser stack to be part of the application at any
given moment in time. after all, the user has access to these pages.
the pages aren't gone and so the server side components shouldn't be either.
i understand that these issues are part of a performance design decision
to pool and reuse page objects.... but i don't agree with that decision
entirely. for those users who would be willing to trade increased
memory use for an even higher level of ease-of-use in the framework, i
think the framework could allow page objects to persist throughout the
user's session. by keeping a stack (again, with some reasonable
developer-definable upper limit) of page objects and associating those
with a hidden field in the rendered HTML, it would be possible for every
page rendered to be tied back to the page object that created it. the
stack would be adjusted based on what pages get submitted so that it
always tracked what was in the user's browser page stack.
i've implemented this sort of scheme in the past as part of a couple of
web ui frameworks i created on different projects and it works out
really well. with clustering and $400 emachines boxes, i find it hard
to worry about having more first class objects around that will make my
job far easier. as long as the feature was optional, wouldn't it be an
improvement?
comments?
thanks for listening,
jon
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Norbert Sándor <pr...@hotmail.com>.
NO, because for example Hidden uses the same method to write the hidden
field which should be left untouched.
Additionally we need some support from the framework to get these values
from other locations than the request (my implementation stores them in the
session).
Norbi
----- Original Message -----
From: "Jonathan Locke" <jo...@muppetlabs.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, April 22, 2004 6:33 AM
Subject: Re: page lifecycle
>
> on bug #28382, can't we already subclass Form if we want to?
>
> just make a new component SecureForm and override addHiddenValue...
> wouldn't that work?
>
> Programozás wrote:
>
> >I think, there are pros:
> >- it may save development time
> >- I had problems with page pooling when I tried to implement (really)
> >dynamical portal-like application. I fell back to using Blocks instead
but
> >it's just not the same.
> >- If I'm right then it would solve problems with "state-stored-in-page"
> >components (like ListEdit)
> >
> >But:
> >- some components in my application are very complex, storing the whole
> >rendered component tree in the session would probably result terrible
> >performance
> >- the session could be very large: in a cluster this may slow down the
> >entire application down
> >
> >Solution:
> >I had the same problem some days ago. I wanted to implement a stack of
> >previously rendered pages to allow full application flow control.
Tapestry
> >is very extensible but this requires some enhancements in the framework.
> >These are listed as 28381 and 28382 in bugzilla (if I'm right).
> >
> >Now I have a dirty solution for this: I have modified 2 framework classes
> >(RequestContext and Form) and wrapped all exisiting services in my own
> >implementations. So it's ALMOST possible with the current Tapestry
release
> >but it really involves some extra dirty work.
> >
> >Norbi
> >
> >----- Original Message -----
> >From: "Robert" <ca...@linuxmail.org>
> >To: <ta...@jakarta.apache.org>
> >Sent: Sunday, April 18, 2004 2:44 AM
> >Subject: Re: page lifecycle
> >
> >
> >
> >
> >>"Bryan Lewis" <br...@maine.rr.com> wrote in message
> >>news:002b01c424dd$cd8d7a30$6401a8c0@pit...
> >>
> >>
> >>>I think he's talking about keeping old copies of pages for a while
after
> >>>they've been used, complete with all their state. At present Tapestry
> >>>re-inits and re-pools a page after it's used. The suggestion is to
keep
> >>>all that old state. The benefit is, when the user back-buttons to a
> >>>previous page on the client side, the server can retrieve that page
> >>>exactly as it was. WebObjects does this -- it keeps past pages up to a
> >>>configurable limit called the "backtracking limit".
> >>>
> >>>
> >>>
> >>I think that would be cool.
> >>
> >>Robert
> >>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
on bug #28382, can't we already subclass Form if we want to?
just make a new component SecureForm and override addHiddenValue...
wouldn't that work?
Programozás wrote:
>I think, there are pros:
>- it may save development time
>- I had problems with page pooling when I tried to implement (really)
>dynamical portal-like application. I fell back to using Blocks instead but
>it's just not the same.
>- If I'm right then it would solve problems with "state-stored-in-page"
>components (like ListEdit)
>
>But:
>- some components in my application are very complex, storing the whole
>rendered component tree in the session would probably result terrible
>performance
>- the session could be very large: in a cluster this may slow down the
>entire application down
>
>Solution:
>I had the same problem some days ago. I wanted to implement a stack of
>previously rendered pages to allow full application flow control. Tapestry
>is very extensible but this requires some enhancements in the framework.
>These are listed as 28381 and 28382 in bugzilla (if I'm right).
>
>Now I have a dirty solution for this: I have modified 2 framework classes
>(RequestContext and Form) and wrapped all exisiting services in my own
>implementations. So it's ALMOST possible with the current Tapestry release
>but it really involves some extra dirty work.
>
>Norbi
>
>----- Original Message -----
>From: "Robert" <ca...@linuxmail.org>
>To: <ta...@jakarta.apache.org>
>Sent: Sunday, April 18, 2004 2:44 AM
>Subject: Re: page lifecycle
>
>
>
>
>>"Bryan Lewis" <br...@maine.rr.com> wrote in message
>>news:002b01c424dd$cd8d7a30$6401a8c0@pit...
>>
>>
>>>I think he's talking about keeping old copies of pages for a while after
>>>they've been used, complete with all their state. At present Tapestry
>>>re-inits and re-pools a page after it's used. The suggestion is to keep
>>>all that old state. The benefit is, when the user back-buttons to a
>>>previous page on the client side, the server can retrieve that page
>>>exactly as it was. WebObjects does this -- it keeps past pages up to a
>>>configurable limit called the "backtracking limit".
>>>
>>>
>>>
>>I think that would be cool.
>>
>>Robert
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Programozás <pr...@hotmail.com>.
I think, there are pros:
- it may save development time
- I had problems with page pooling when I tried to implement (really)
dynamical portal-like application. I fell back to using Blocks instead but
it's just not the same.
- If I'm right then it would solve problems with "state-stored-in-page"
components (like ListEdit)
But:
- some components in my application are very complex, storing the whole
rendered component tree in the session would probably result terrible
performance
- the session could be very large: in a cluster this may slow down the
entire application down
Solution:
I had the same problem some days ago. I wanted to implement a stack of
previously rendered pages to allow full application flow control. Tapestry
is very extensible but this requires some enhancements in the framework.
These are listed as 28381 and 28382 in bugzilla (if I'm right).
Now I have a dirty solution for this: I have modified 2 framework classes
(RequestContext and Form) and wrapped all exisiting services in my own
implementations. So it's ALMOST possible with the current Tapestry release
but it really involves some extra dirty work.
Norbi
----- Original Message -----
From: "Robert" <ca...@linuxmail.org>
To: <ta...@jakarta.apache.org>
Sent: Sunday, April 18, 2004 2:44 AM
Subject: Re: page lifecycle
> "Bryan Lewis" <br...@maine.rr.com> wrote in message
> news:002b01c424dd$cd8d7a30$6401a8c0@pit...
> > I think he's talking about keeping old copies of pages for a while after
> > they've been used, complete with all their state. At present Tapestry
> > re-inits and re-pools a page after it's used. The suggestion is to keep
> > all that old state. The benefit is, when the user back-buttons to a
> > previous page on the client side, the server can retrieve that page
> > exactly as it was. WebObjects does this -- it keeps past pages up to a
> > configurable limit called the "backtracking limit".
> >
> I think that would be cool.
>
> Robert
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Robert <ca...@linuxmail.org>.
"Bryan Lewis" <br...@maine.rr.com> wrote in message
news:002b01c424dd$cd8d7a30$6401a8c0@pit...
> I think he's talking about keeping old copies of pages for a while after
> they've been used, complete with all their state. At present Tapestry
> re-inits and re-pools a page after it's used. The suggestion is to keep
> all that old state. The benefit is, when the user back-buttons to a
> previous page on the client side, the server can retrieve that page
> exactly as it was. WebObjects does this -- it keeps past pages up to a
> configurable limit called the "backtracking limit".
>
I think that would be cool.
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
Vince Marco wrote:
> Why can't you do this by binding existing forms either in
> page-persistent properties or the visit? When a page is revisited all
> dynamic content (ie. forms, etc) would be pre-populated with the
> session data. I don't see what is missing from the framework
> currently to prevent this, and it isn't difficult to set this up.
>
you absolutely can work around this issue. i'm merely suggesting as a
convenience that something be done about this issue to make life easier
for everyone that uses the framework. it seems to be the tapestry way
to simplify coding tasks by pushing work like this into the framework.
that's a big part of its appeal to me! the question (which perhaps
remains to be answered) is whether this can be done in a way that makes
everyone happy (or most everyone) and still maintains (or improves!)
performance and supports existing code using the framework.
> Do you have an example of something that tapestry fails to handle in
> this regard?
>
> If you buffer pages don't you get into a possible problem of stale
> form data due to accessing pages out of order? I think I'd rather
> manage the form data separate from a page history for this reason.
>
> Vince
>
> On Apr 17, 2004, at 6:40 PM, Bryan Lewis wrote:
>
>> I think he's talking about keeping old copies of pages for a while after
>> they've been used, complete with all their state. At present Tapestry
>> re-inits and re-pools a page after it's used. The suggestion is to keep
>> all that old state. The benefit is, when the user back-buttons to a
>> previous page on the client side, the server can retrieve that page
>> exactly as it was. WebObjects does this -- it keeps past pages up to a
>> configurable limit called the "backtracking limit".
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Vince Marco <vm...@mac.com>.
Why can't you do this by binding existing forms either in
page-persistent properties or the visit? When a page is revisited all
dynamic content (ie. forms, etc) would be pre-populated with the
session data. I don't see what is missing from the framework currently
to prevent this, and it isn't difficult to set this up.
Do you have an example of something that tapestry fails to handle in
this regard?
If you buffer pages don't you get into a possible problem of stale form
data due to accessing pages out of order? I think I'd rather manage
the form data separate from a page history for this reason.
Vince
On Apr 17, 2004, at 6:40 PM, Bryan Lewis wrote:
> I think he's talking about keeping old copies of pages for a while
> after
> they've been used, complete with all their state. At present Tapestry
> re-inits and re-pools a page after it's used. The suggestion is to
> keep
> all that old state. The benefit is, when the user back-buttons to a
> previous page on the client side, the server can retrieve that page
> exactly as it was. WebObjects does this -- it keeps past pages up to a
> configurable limit called the "backtracking limit".
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: [Strange Behavior] Submit Listener and the Form Listener
Posted by Alex Kwan <er...@hotmail.com>.
Maybe this problem was caused by the browser, has anybody encounter this
problem too?
----- Original Message -----
From: "Alex Kwan" <er...@hotmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, April 19, 2004 9:29 PM
Subject: Re: [Strange Behavior] Submit Listener and the Form Listener
> In Some browser, if you press enter in some field, that action equals to
> clicking the default submit button, that's why this form can be submitted.
> And in some form, the listener of the submit button will be invoked if you
> press enter in some fields, that's why I say this behavior is
inconsistent.
>
>
> ----- Original Message -----
> From: "Programozás" <pr...@hotmail.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Monday, April 19, 2004 9:20 PM
> Subject: Re: [Strange Behavior] Submit Listener and the Form Listener
>
>
> > It's logical I think:
> > - you press a submit button: your button's listener is invoked
> > - you press the enter in a field: nobody knows which submit button's
> > listener should be invoked
> >
> > In your case simply do not specify the listener of the submit button
(you
> > may not use the Submit component at all, only simple html submit).
> > Only specify the listener of the Form.
> >
> > Norbi
> >
> > ----- Original Message -----
> > From: "Alex Kwan" <er...@hotmail.com>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Monday, April 19, 2004 3:11 PM
> > Subject: [Strange Behavior] Submit Listener and the Form Listener
> >
> >
> > > Hi, All
> > > I found a inconsistent and strange behavior when submitting a
form.
> > >
> > > If a form only contains a validFiled and a Submit, when user enter
> > some
> > > data in the valid field and press enter.
> > > The form submitted. But only the form listener is invoked. The
listener
> of
> > > the submit button did not hear anything.
> > >
> > > But in some completed form, the submit button listener will be
> invoke
> > > too.
> > >
> > > I do not know whether this is a bug of browser or a bug of
Tapestry.
> > > Anybody has this similar problem?
> > > How do I let the tapestry always fire the listener of the submit
> > button?
> > >
> > > Thanks in advance.
> > >
> > > Alex
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: [Strange Behavior] Submit Listener and the Form Listener
Posted by Alex Kwan <er...@hotmail.com>.
In Some browser, if you press enter in some field, that action equals to
clicking the default submit button, that's why this form can be submitted.
And in some form, the listener of the submit button will be invoked if you
press enter in some fields, that's why I say this behavior is inconsistent.
----- Original Message -----
From: "Programozás" <pr...@hotmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, April 19, 2004 9:20 PM
Subject: Re: [Strange Behavior] Submit Listener and the Form Listener
> It's logical I think:
> - you press a submit button: your button's listener is invoked
> - you press the enter in a field: nobody knows which submit button's
> listener should be invoked
>
> In your case simply do not specify the listener of the submit button (you
> may not use the Submit component at all, only simple html submit).
> Only specify the listener of the Form.
>
> Norbi
>
> ----- Original Message -----
> From: "Alex Kwan" <er...@hotmail.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Monday, April 19, 2004 3:11 PM
> Subject: [Strange Behavior] Submit Listener and the Form Listener
>
>
> > Hi, All
> > I found a inconsistent and strange behavior when submitting a form.
> >
> > If a form only contains a validFiled and a Submit, when user enter
> some
> > data in the valid field and press enter.
> > The form submitted. But only the form listener is invoked. The listener
of
> > the submit button did not hear anything.
> >
> > But in some completed form, the submit button listener will be
invoke
> > too.
> >
> > I do not know whether this is a bug of browser or a bug of Tapestry.
> > Anybody has this similar problem?
> > How do I let the tapestry always fire the listener of the submit
> button?
> >
> > Thanks in advance.
> >
> > Alex
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: [Strange Behavior] Submit Listener and the Form Listener
Posted by Programozás <pr...@hotmail.com>.
It's logical I think:
- you press a submit button: your button's listener is invoked
- you press the enter in a field: nobody knows which submit button's
listener should be invoked
In your case simply do not specify the listener of the submit button (you
may not use the Submit component at all, only simple html submit).
Only specify the listener of the Form.
Norbi
----- Original Message -----
From: "Alex Kwan" <er...@hotmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, April 19, 2004 3:11 PM
Subject: [Strange Behavior] Submit Listener and the Form Listener
> Hi, All
> I found a inconsistent and strange behavior when submitting a form.
>
> If a form only contains a validFiled and a Submit, when user enter
some
> data in the valid field and press enter.
> The form submitted. But only the form listener is invoked. The listener of
> the submit button did not hear anything.
>
> But in some completed form, the submit button listener will be invoke
> too.
>
> I do not know whether this is a bug of browser or a bug of Tapestry.
> Anybody has this similar problem?
> How do I let the tapestry always fire the listener of the submit
button?
>
> Thanks in advance.
>
> Alex
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
[Strange Behavior] Submit Listener and the Form Listener
Posted by Alex Kwan <er...@hotmail.com>.
Hi, All
I found a inconsistent and strange behavior when submitting a form.
If a form only contains a validFiled and a Submit, when user enter some
data in the valid field and press enter.
The form submitted. But only the form listener is invoked. The listener of
the submit button did not hear anything.
But in some completed form, the submit button listener will be invoke
too.
I do not know whether this is a bug of browser or a bug of Tapestry.
Anybody has this similar problem?
How do I let the tapestry always fire the listener of the submit button?
Thanks in advance.
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
Petter Måhlén wrote:
>I really like this line of thought - and if I am right, it's part of what
>Howard was looking at doing for 3.1 anyway
>
>
i'd love to hear what he's thinking.
>(http://wiki.apache.org/jakarta-tapestry/Tapestry31, section on Reworking
>Component Parameters). I think that what you are suggesting, probably
>coupled with a well-defined set of initialisation methods for each type of
>scope, would be a great simplification. Also, component properties and
>parameters would need to be dealt with in a similar way - a single component
>can occur multiple times on one page, for instance, so special care needs to
>be taken for "session" scope properties.
>
>
>
yeah, i think you're right. i'd like to modify my cunning scheme... ;-)
the scope for component properties should be one of "local", "class" or
"instance", just like java variables/fields.
then *pages* (and only pages) would have an "instance-model" parameter
that would be either "one" (static content), "one-per-session" (current
model) or "many" (object on a server-side page stack). this parameter,
if missing, would default to "one-per-session", so that existing code
continues to work as it always has.
in this model, components are fully independent of their context and
their properties will be automatically assigned the right lifetime based
on the instance-model of the page they were included on.
finally, the application spec would define a
"default-page-instance-model" that pages could inherit (so they don't
have to define this parameter all the time). the default for this
parameter would, of course, be "one-per-session", enabling everything to
work as it always has.
does this make more sense now?
>I posted some thoughts on this subject in
>http://thread.gmane.org/gmane.comp.java.tapestry.user/7743 that I think are
>pretty close to what you're suggesting.
>
>/ Petter
>
>
>
>>-----Original Message-----
>>From: Jonathan Locke [mailto:jonl@muppetlabs.com]
>>Sent: den 19 april 2004 07:54
>>To: Tapestry users
>>Subject: Re: page lifecycle
>>
>>
>>
>>actually, come to think of it this has to be /fairly/
>>straightforward,
>>because tapestry's so well structured!!
>>
>>my bet is that the right parts of the page structure in tapestry are
>>virtually all static and class-like already. the main thing
>>that would
>>need to be changed would be the scope/lifetime of component
>>properties.
>>
>>since most good tapestry properties are synthetic, you could
>>easily add
>>a declarative syntax to specify a scope for each property.
>>for example:
>>
>> <property-specification name = "indexVariable" type =
>>"int" scope =
>>"local"/>
>> <property-specification name = "uidUser" type = "int" scope =
>>"instance"/>
>>
>>this fictional new "scope" parameter would allow the developer to
>>specify the intended scope of the given property.
>>
>> - if the scope were "local", then the property would be discarded
>>entirely when the page containing the component was sent back
>>to the pool.
>>
>> - if the scope were "session", then the property would behave as it
>>does now ("scope = session" would be the same as "persistent = yes",
>>which could be deprecated).
>>
>> - if the scope were "class", then the property would be part of the
>>global definition of the component and when a page was
>>returned to the
>>pool, the property would not be reset.
>>
>> - if the scope were "instance" then the property would be
>>saved along
>>with other instance properties on the page (in some kind of
>>map... or a
>>synthetic container?) in the HttpSession. the main difference from
>>"session" scope would be that the key used to retrieve each property
>>would be prefixed with a page-instance-id. the
>>page-instance-id would
>>be stored as a hidden field in each page generated (probably
>>each page
>>with instance properties would be sufficient... others might
>>be ignored
>>and perhaps would not need to be part of the page stack). the
>>engine/service dispatch process (i'm fuzzy on this) would
>>also have to
>>be modified to rig up a fresh page instance from the pool
>>with the right
>>values from the session.
>>
>>while it's not totally clear to me that this is the right thing for
>>tapestry (since i don't understand the existing architecture deeply),
>>there might be some big potential benefits if it could be worked out
>>somehow...
>>
>> - it would be very java and very tapestry to work this way... the
>>model would be easy to understand because it's more familiar and more
>>OO. perhaps, in a really seamless implementation, quite a
>>few sections
>>of the tapestry in action book could be condensed or removed.
>>
>> - you might be able to accomplish a great deal of this object
>>orientation with low overhead (basically, in a good implementation...
>>you'd wind up with roughly the *same* overhead you'd have
>>doing all this
>>stuff by hand) while still supporting old scoping uses.
>>
>> - intelligent use of "instance" scoped properties would
>>allow you to
>>handle the browser back button problem with virtually no
>>effort/code.
>>just declare your properties' scopes correctly and they'll
>>stick around
>>in the right way.
>>
>> - you might be able to get transparent clustering support if your
>>application used only synthetic/declarative properties (and
>>non-synthetic properties could be retrofitted). basically,
>>the server
>>state that the cluster needs to know about is all the stuff that was
>>tagged as either "session" or "instance". this can all be
>>*automatically* be placed into the HttpSession. (note: since
>>the stack
>>can go backwards and then forwards, there might need to be a way to
>>*remove* session attributes, but this too could be automated)
>>
>> - there might no longer be a need to tag pages as stateful
>>or not...
>>traversing the component tree (just once, when the page is loaded)
>>looking for "session" and "instance" scope properties could
>>automatically determine if the page is stateful.
>>
>>comments?
>>
>>Jonathan Locke wrote:
>>
>>
>>
>>>yes and no. it shouldn't be implemented naively. but the effect
>>>should be basically what you describe.
>>>
>>>the thing about tapestry pages is that they're part class and part
>>>pooled singleton (one instance per-session anyway) object.
>>>
>>>
>>at least,
>>
>>
>>>as i understand them ;-)
>>>
>>>perhaps the thing to do is to more fully separate any (dynamic)
>>>instance data from the page's (static) "class" information. the
>>>"class" part of the page and it's component tree would then
>>>
>>>
>>be fully
>>
>>
>>>sharable between any number of instances (and therefore
>>>
>>>
>>page classes
>>
>>
>>>could be fully multithreaded, unsynchronized singletons). the
>>>instance part of the page could then be separated out into
>>>
>>>
>>a parallel
>>
>>
>>>data structure. then when you put the class part together with the
>>>instance part you get what is now a page. but the neat thing about
>>>making such a separation is that you could implement pages
>>>
>>>
>>as they are
>>
>>
>>>now AND you could create this optional page stack
>>>
>>>
>>implementation i'm
>>
>>
>>>describing where each session holds multiple instances of the same
>>>page "class".
>>>
>>>all this said, i have not yet stared at the tapestry framework code
>>>for long enough to know if what i'm suggesting is a fairly
>>>straightforward change or something that would require a
>>>
>>>
>>huge amount
>>
>>
>>>of work.
>>>
>>>Bryan Lewis wrote:
>>>
>>>
>>>
>>>>I think he's talking about keeping old copies of pages for
>>>>
>>>>
>>a while after
>>
>>
>>>>they've been used, complete with all their state. At
>>>>
>>>>
>>present Tapestry
>>
>>
>>>>re-inits and re-pools a page after it's used. The
>>>>
>>>>
>>suggestion is to keep
>>
>>
>>>>all that old state. The benefit is, when the user
>>>>
>>>>
>>back-buttons to a
>>
>>
>>>>previous page on the client side, the server can retrieve that page
>>>>exactly as it was. WebObjects does this -- it keeps past
>>>>
>>>>
>>pages up to a
>>
>>
>>>>configurable limit called the "backtracking limit".
>>>>
>>>>
>>>>----- Original Message ----- From: "Robert Zeigler"
>>>><rd...@u.arizona.edu>
>>>>To: "Tapestry users" <ta...@jakarta.apache.org>
>>>>Sent: Saturday, April 17, 2004 7:39 PM
>>>>Subject: Re: page lifecycle
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Maybe I'm just misunderstanding you, but... isn't that
>>>>>
>>>>>
>>what persistent
>>
>>
>>>>>page properties are for (keeping track of page-specific
>>>>>
>>>>>
>>information
>>
>>
>>>>>
>>>>>
>>>>>
>>>>for
>>>>
>>>>
>>>>
>>>>
>>>>>a given user)?
>>>>><property-specification name="myProperty" type="path.to.Class"
>>>>>persistent="yes"/>
>>>>>
>>>>>Robert
>>>>>
>>>>>
>>>>>
>>>>>
>>---------------------------------------------------------------------
>>
>>
>>>>>To unsubscribe, e-mail:
>>>>>
>>>>>
>>tapestry-user-unsubscribe@jakarta.apache.org
>>
>>
>>>>>For additional commands, e-mail:
>>>>>
>>>>>
>>tapestry-user-help@jakarta.apache.org
>>
>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>---------------------------------------------------------------------
>>
>>
>>>>To unsubscribe, e-mail:
>>>>
>>>>
>>tapestry-user-unsubscribe@jakarta.apache.org
>>
>>
>>>>For additional commands, e-mail:
>>>>
>>>>
>>tapestry-user-help@jakarta.apache.org
>>
>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>---------------------------------------------------------------------
>>
>>
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail:
>>>
>>>
>>tapestry-user-help@jakarta.apache.org
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: page lifecycle
Posted by Petter Måhlén <pe...@elevance.se>.
I really like this line of thought - and if I am right, it's part of what
Howard was looking at doing for 3.1 anyway
(http://wiki.apache.org/jakarta-tapestry/Tapestry31, section on Reworking
Component Parameters). I think that what you are suggesting, probably
coupled with a well-defined set of initialisation methods for each type of
scope, would be a great simplification. Also, component properties and
parameters would need to be dealt with in a similar way - a single component
can occur multiple times on one page, for instance, so special care needs to
be taken for "session" scope properties.
I posted some thoughts on this subject in
http://thread.gmane.org/gmane.comp.java.tapestry.user/7743 that I think are
pretty close to what you're suggesting.
/ Petter
> -----Original Message-----
> From: Jonathan Locke [mailto:jonl@muppetlabs.com]
> Sent: den 19 april 2004 07:54
> To: Tapestry users
> Subject: Re: page lifecycle
>
>
>
> actually, come to think of it this has to be /fairly/
> straightforward,
> because tapestry's so well structured!!
>
> my bet is that the right parts of the page structure in tapestry are
> virtually all static and class-like already. the main thing
> that would
> need to be changed would be the scope/lifetime of component
> properties.
>
> since most good tapestry properties are synthetic, you could
> easily add
> a declarative syntax to specify a scope for each property.
> for example:
>
> <property-specification name = "indexVariable" type =
> "int" scope =
> "local"/>
> <property-specification name = "uidUser" type = "int" scope =
> "instance"/>
>
> this fictional new "scope" parameter would allow the developer to
> specify the intended scope of the given property.
>
> - if the scope were "local", then the property would be discarded
> entirely when the page containing the component was sent back
> to the pool.
>
> - if the scope were "session", then the property would behave as it
> does now ("scope = session" would be the same as "persistent = yes",
> which could be deprecated).
>
> - if the scope were "class", then the property would be part of the
> global definition of the component and when a page was
> returned to the
> pool, the property would not be reset.
>
> - if the scope were "instance" then the property would be
> saved along
> with other instance properties on the page (in some kind of
> map... or a
> synthetic container?) in the HttpSession. the main difference from
> "session" scope would be that the key used to retrieve each property
> would be prefixed with a page-instance-id. the
> page-instance-id would
> be stored as a hidden field in each page generated (probably
> each page
> with instance properties would be sufficient... others might
> be ignored
> and perhaps would not need to be part of the page stack). the
> engine/service dispatch process (i'm fuzzy on this) would
> also have to
> be modified to rig up a fresh page instance from the pool
> with the right
> values from the session.
>
> while it's not totally clear to me that this is the right thing for
> tapestry (since i don't understand the existing architecture deeply),
> there might be some big potential benefits if it could be worked out
> somehow...
>
> - it would be very java and very tapestry to work this way... the
> model would be easy to understand because it's more familiar and more
> OO. perhaps, in a really seamless implementation, quite a
> few sections
> of the tapestry in action book could be condensed or removed.
>
> - you might be able to accomplish a great deal of this object
> orientation with low overhead (basically, in a good implementation...
> you'd wind up with roughly the *same* overhead you'd have
> doing all this
> stuff by hand) while still supporting old scoping uses.
>
> - intelligent use of "instance" scoped properties would
> allow you to
> handle the browser back button problem with virtually no
> effort/code.
> just declare your properties' scopes correctly and they'll
> stick around
> in the right way.
>
> - you might be able to get transparent clustering support if your
> application used only synthetic/declarative properties (and
> non-synthetic properties could be retrofitted). basically,
> the server
> state that the cluster needs to know about is all the stuff that was
> tagged as either "session" or "instance". this can all be
> *automatically* be placed into the HttpSession. (note: since
> the stack
> can go backwards and then forwards, there might need to be a way to
> *remove* session attributes, but this too could be automated)
>
> - there might no longer be a need to tag pages as stateful
> or not...
> traversing the component tree (just once, when the page is loaded)
> looking for "session" and "instance" scope properties could
> automatically determine if the page is stateful.
>
> comments?
>
> Jonathan Locke wrote:
>
> >
> > yes and no. it shouldn't be implemented naively. but the effect
> > should be basically what you describe.
> >
> > the thing about tapestry pages is that they're part class and part
> > pooled singleton (one instance per-session anyway) object.
> at least,
> > as i understand them ;-)
> >
> > perhaps the thing to do is to more fully separate any (dynamic)
> > instance data from the page's (static) "class" information. the
> > "class" part of the page and it's component tree would then
> be fully
> > sharable between any number of instances (and therefore
> page classes
> > could be fully multithreaded, unsynchronized singletons). the
> > instance part of the page could then be separated out into
> a parallel
> > data structure. then when you put the class part together with the
> > instance part you get what is now a page. but the neat thing about
> > making such a separation is that you could implement pages
> as they are
> > now AND you could create this optional page stack
> implementation i'm
> > describing where each session holds multiple instances of the same
> > page "class".
> >
> > all this said, i have not yet stared at the tapestry framework code
> > for long enough to know if what i'm suggesting is a fairly
> > straightforward change or something that would require a
> huge amount
> > of work.
> >
> > Bryan Lewis wrote:
> >
> >> I think he's talking about keeping old copies of pages for
> a while after
> >> they've been used, complete with all their state. At
> present Tapestry
> >> re-inits and re-pools a page after it's used. The
> suggestion is to keep
> >> all that old state. The benefit is, when the user
> back-buttons to a
> >> previous page on the client side, the server can retrieve that page
> >> exactly as it was. WebObjects does this -- it keeps past
> pages up to a
> >> configurable limit called the "backtracking limit".
> >>
> >>
> >> ----- Original Message ----- From: "Robert Zeigler"
> >> <rd...@u.arizona.edu>
> >> To: "Tapestry users" <ta...@jakarta.apache.org>
> >> Sent: Saturday, April 17, 2004 7:39 PM
> >> Subject: Re: page lifecycle
> >>
> >>
> >>
> >>
> >>> Maybe I'm just misunderstanding you, but... isn't that
> what persistent
> >>> page properties are for (keeping track of page-specific
> information
> >>>
> >>
> >> for
> >>
> >>
> >>> a given user)?
> >>> <property-specification name="myProperty" type="path.to.Class"
> >>> persistent="yes"/>
> >>>
> >>> Robert
> >>>
> >>>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
actually, come to think of it this has to be /fairly/ straightforward,
because tapestry's so well structured!!
my bet is that the right parts of the page structure in tapestry are
virtually all static and class-like already. the main thing that would
need to be changed would be the scope/lifetime of component properties.
since most good tapestry properties are synthetic, you could easily add
a declarative syntax to specify a scope for each property. for example:
<property-specification name = "indexVariable" type = "int" scope =
"local"/>
<property-specification name = "uidUser" type = "int" scope =
"instance"/>
this fictional new "scope" parameter would allow the developer to
specify the intended scope of the given property.
- if the scope were "local", then the property would be discarded
entirely when the page containing the component was sent back to the pool.
- if the scope were "session", then the property would behave as it
does now ("scope = session" would be the same as "persistent = yes",
which could be deprecated).
- if the scope were "class", then the property would be part of the
global definition of the component and when a page was returned to the
pool, the property would not be reset.
- if the scope were "instance" then the property would be saved along
with other instance properties on the page (in some kind of map... or a
synthetic container?) in the HttpSession. the main difference from
"session" scope would be that the key used to retrieve each property
would be prefixed with a page-instance-id. the page-instance-id would
be stored as a hidden field in each page generated (probably each page
with instance properties would be sufficient... others might be ignored
and perhaps would not need to be part of the page stack). the
engine/service dispatch process (i'm fuzzy on this) would also have to
be modified to rig up a fresh page instance from the pool with the right
values from the session.
while it's not totally clear to me that this is the right thing for
tapestry (since i don't understand the existing architecture deeply),
there might be some big potential benefits if it could be worked out
somehow...
- it would be very java and very tapestry to work this way... the
model would be easy to understand because it's more familiar and more
OO. perhaps, in a really seamless implementation, quite a few sections
of the tapestry in action book could be condensed or removed.
- you might be able to accomplish a great deal of this object
orientation with low overhead (basically, in a good implementation...
you'd wind up with roughly the *same* overhead you'd have doing all this
stuff by hand) while still supporting old scoping uses.
- intelligent use of "instance" scoped properties would allow you to
handle the browser back button problem with virtually no effort/code.
just declare your properties' scopes correctly and they'll stick around
in the right way.
- you might be able to get transparent clustering support if your
application used only synthetic/declarative properties (and
non-synthetic properties could be retrofitted). basically, the server
state that the cluster needs to know about is all the stuff that was
tagged as either "session" or "instance". this can all be
*automatically* be placed into the HttpSession. (note: since the stack
can go backwards and then forwards, there might need to be a way to
*remove* session attributes, but this too could be automated)
- there might no longer be a need to tag pages as stateful or not...
traversing the component tree (just once, when the page is loaded)
looking for "session" and "instance" scope properties could
automatically determine if the page is stateful.
comments?
Jonathan Locke wrote:
>
> yes and no. it shouldn't be implemented naively. but the effect
> should be basically what you describe.
>
> the thing about tapestry pages is that they're part class and part
> pooled singleton (one instance per-session anyway) object. at least,
> as i understand them ;-)
>
> perhaps the thing to do is to more fully separate any (dynamic)
> instance data from the page's (static) "class" information. the
> "class" part of the page and it's component tree would then be fully
> sharable between any number of instances (and therefore page classes
> could be fully multithreaded, unsynchronized singletons). the
> instance part of the page could then be separated out into a parallel
> data structure. then when you put the class part together with the
> instance part you get what is now a page. but the neat thing about
> making such a separation is that you could implement pages as they are
> now AND you could create this optional page stack implementation i'm
> describing where each session holds multiple instances of the same
> page "class".
>
> all this said, i have not yet stared at the tapestry framework code
> for long enough to know if what i'm suggesting is a fairly
> straightforward change or something that would require a huge amount
> of work.
>
> Bryan Lewis wrote:
>
>> I think he's talking about keeping old copies of pages for a while after
>> they've been used, complete with all their state. At present Tapestry
>> re-inits and re-pools a page after it's used. The suggestion is to keep
>> all that old state. The benefit is, when the user back-buttons to a
>> previous page on the client side, the server can retrieve that page
>> exactly as it was. WebObjects does this -- it keeps past pages up to a
>> configurable limit called the "backtracking limit".
>>
>>
>> ----- Original Message ----- From: "Robert Zeigler"
>> <rd...@u.arizona.edu>
>> To: "Tapestry users" <ta...@jakarta.apache.org>
>> Sent: Saturday, April 17, 2004 7:39 PM
>> Subject: Re: page lifecycle
>>
>>
>>
>>
>>> Maybe I'm just misunderstanding you, but... isn't that what persistent
>>> page properties are for (keeping track of page-specific information
>>>
>>
>> for
>>
>>
>>> a given user)?
>>> <property-specification name="myProperty" type="path.to.Class"
>>> persistent="yes"/>
>>>
>>> Robert
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
yes and no. it shouldn't be implemented naively. but the effect should
be basically what you describe.
the thing about tapestry pages is that they're part class and part
pooled singleton (one instance per-session anyway) object. at least, as
i understand them ;-)
perhaps the thing to do is to more fully separate any (dynamic) instance
data from the page's (static) "class" information. the "class" part of
the page and it's component tree would then be fully sharable between
any number of instances (and therefore page classes could be fully
multithreaded, unsynchronized singletons). the instance part of the
page could then be separated out into a parallel data structure. then
when you put the class part together with the instance part you get what
is now a page. but the neat thing about making such a separation is
that you could implement pages as they are now AND you could create this
optional page stack implementation i'm describing where each session
holds multiple instances of the same page "class".
all this said, i have not yet stared at the tapestry framework code for
long enough to know if what i'm suggesting is a fairly straightforward
change or something that would require a huge amount of work.
Bryan Lewis wrote:
>I think he's talking about keeping old copies of pages for a while after
>they've been used, complete with all their state. At present Tapestry
>re-inits and re-pools a page after it's used. The suggestion is to keep
>all that old state. The benefit is, when the user back-buttons to a
>previous page on the client side, the server can retrieve that page
>exactly as it was. WebObjects does this -- it keeps past pages up to a
>configurable limit called the "backtracking limit".
>
>
>----- Original Message -----
>From: "Robert Zeigler" <rd...@u.arizona.edu>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Saturday, April 17, 2004 7:39 PM
>Subject: Re: page lifecycle
>
>
>
>
>>Maybe I'm just misunderstanding you, but... isn't that what persistent
>>page properties are for (keeping track of page-specific information
>>
>>
>for
>
>
>>a given user)?
>><property-specification name="myProperty" type="path.to.Class"
>>persistent="yes"/>
>>
>>Robert
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Bryan Lewis <br...@maine.rr.com>.
I think he's talking about keeping old copies of pages for a while after
they've been used, complete with all their state. At present Tapestry
re-inits and re-pools a page after it's used. The suggestion is to keep
all that old state. The benefit is, when the user back-buttons to a
previous page on the client side, the server can retrieve that page
exactly as it was. WebObjects does this -- it keeps past pages up to a
configurable limit called the "backtracking limit".
----- Original Message -----
From: "Robert Zeigler" <rd...@u.arizona.edu>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Saturday, April 17, 2004 7:39 PM
Subject: Re: page lifecycle
> Maybe I'm just misunderstanding you, but... isn't that what persistent
> page properties are for (keeping track of page-specific information
for
> a given user)?
> <property-specification name="myProperty" type="path.to.Class"
> persistent="yes"/>
>
> Robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
i'm no expert at tapestry yet, but my understanding of persistent page
properties is that they are sort of "singleton per session". in other
words, you can't have two page instances in a session with different
persistent properties. someone please correct me if i'm wrong here! ;-)
Robert Zeigler wrote:
> Maybe I'm just misunderstanding you, but... isn't that what persistent
> page properties are for (keeping track of page-specific information
> for a given user)?
> <property-specification name="myProperty" type="path.to.Class"
> persistent="yes"/>
>
> Robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Robert Zeigler <rd...@u.arizona.edu>.
Maybe I'm just misunderstanding you, but... isn't that what persistent
page properties are for (keeping track of page-specific information for
a given user)?
<property-specification name="myProperty" type="path.to.Class"
persistent="yes"/>
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Jonathan Locke <jo...@muppetlabs.com>.
Mindbridge wrote:
>Hi,
>
>I think part of the confusion comes from the fact that Tapestry essentially
>splits logic and data. The logic (the page tree, i..e. the page object plus
>the tree of its component objects) is pooled and then used in a non-session
>specific manner, while data (the persistent properties) is stored and then
>restored when the next request within that session comes along.
>
>This is a positive for at least two reasons:
>- The page tree (the logic) is very complex and its instantiation is very
>slow as a result. Here is practical way to prove that: disable the pooling
>(e.g. by doind -Dorg.apache.tapestry.disable-caching=true) and run a
>tapestry application, say the workbench. The resulting speed of the
>application would be okay for development, but be intolerably low for a live
>site with more than 10 users.
>
>
absolutely.
>- The page tree would be rather large if it is serialized and then put in
>the session. There is the performance issue of serializing/deserializing
>such a large object, but say we can ignore that. More problematic is the
>fact that the sessions would grow quite large and their number is
>proportionate to the number of users. Even if we assume that one has a lot
>of memory and can afford a number of such huge sessions, the application
>would become extremely difficult to be used in a cluster, since the sessions
>are broadcast between the different servers of the cluster and size does
>matter a lot in this case.
>
>
>
yes. i think the trick is to separate out what is truly
class/static/immutable (for example, most or all of the data concerned
with page/component templates/specifications/configurations) from what
is truly required to be object/dynamic/mutable persistent server side
state. as you point out, you couldn't just serialize the whole page
tree in the current implementation. but if pages were refactored, the
actual state information that must be kept around to reconstruct the
page at a later time might actually be fairly small. remember any
class/static/immutable portions of the page tree can always be
reconstructed on any server in the cluster, just like loading a java
class. in fact, odds are that all this information would already be
loaded on a given server in the cluster.
>In short, such a design decision would automatically disqualify Tapestry
>from being used in a lot of situations it is used today. Given the fact that
>persistent properties exist, I think the situations where storing the full
>page tree is essential are very rare.
>
>In terms of the stack, the back button etc -- those issues have been
>discussed (see the dev list) and a comprehensive solution will probably
>become a standard part of 3.1. All of those will be done in a way that will
>(hopefully) not affect performance.
>
>
>
perhaps they're already onto this then!
>In any case, thank you for the good words (Howard deserves the prase here),
>I hope Tapestry helps out with what you are doing.
>
>
>
tapestry totally makes my day.
take care,
jon
>-mb
>
>----- Original Message -----
>From: "Jonathan Locke" <jo...@muppetlabs.com>
>To: <ta...@jakarta.apache.org>
>Sent: Sunday, April 18, 2004 2:09 AM
>Subject: page lifecycle
>
>
>
>
>>this framework and the "Tapestry in Action" book are TOTALLY dyn-o-mite!
>>
>>thanks to everyone involved for (finally!) creating a truly worthwhile
>>framework for doing web UIs.
>>there are very few points of confusion in tapestry and really no fatal
>>flaws that i can perceive.
>>it's totally straightforward and component oriented in almost all aspects.
>>
>>unfortunately, the component model doesn't quite go as far as i'd hoped
>>it would. pages *are* components. no doubt about that. but they are
>>kindof temporary components that do not have an object/component-like
>>meaning with respect to a session using the application. they appear
>>and disappear at a page-request level granularity. this makes it
>>necessary for developers to use all kinds of weird tricks like Hidden
>>fields and Visit/session state to work around issues having to do with
>>the browser back button. it makes more sense to me to consider all the
>>pages (or at least some reasonable number of recent pages... others can
>>expire) in the user's browser stack to be part of the application at any
>>given moment in time. after all, the user has access to these pages.
>>the pages aren't gone and so the server side components shouldn't be
>>
>>
>either.
>
>
>>i understand that these issues are part of a performance design decision
>>to pool and reuse page objects.... but i don't agree with that decision
>>entirely. for those users who would be willing to trade increased
>>memory use for an even higher level of ease-of-use in the framework, i
>>think the framework could allow page objects to persist throughout the
>>user's session. by keeping a stack (again, with some reasonable
>>developer-definable upper limit) of page objects and associating those
>>with a hidden field in the rendered HTML, it would be possible for every
>>page rendered to be tied back to the page object that created it. the
>>stack would be adjusted based on what pages get submitted so that it
>>always tracked what was in the user's browser page stack.
>>
>>i've implemented this sort of scheme in the past as part of a couple of
>>web ui frameworks i created on different projects and it works out
>>really well. with clustering and $400 emachines boxes, i find it hard
>>to worry about having more first class objects around that will make my
>>job far easier. as long as the feature was optional, wouldn't it be an
>>improvement?
>>
>>comments?
>>
>>thanks for listening,
>>
>> jon
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page lifecycle
Posted by Mindbridge <mi...@yahoo.com>.
Hi,
I think part of the confusion comes from the fact that Tapestry essentially
splits logic and data. The logic (the page tree, i..e. the page object plus
the tree of its component objects) is pooled and then used in a non-session
specific manner, while data (the persistent properties) is stored and then
restored when the next request within that session comes along.
This is a positive for at least two reasons:
- The page tree (the logic) is very complex and its instantiation is very
slow as a result. Here is practical way to prove that: disable the pooling
(e.g. by doind -Dorg.apache.tapestry.disable-caching=true) and run a
tapestry application, say the workbench. The resulting speed of the
application would be okay for development, but be intolerably low for a live
site with more than 10 users.
- The page tree would be rather large if it is serialized and then put in
the session. There is the performance issue of serializing/deserializing
such a large object, but say we can ignore that. More problematic is the
fact that the sessions would grow quite large and their number is
proportionate to the number of users. Even if we assume that one has a lot
of memory and can afford a number of such huge sessions, the application
would become extremely difficult to be used in a cluster, since the sessions
are broadcast between the different servers of the cluster and size does
matter a lot in this case.
In short, such a design decision would automatically disqualify Tapestry
from being used in a lot of situations it is used today. Given the fact that
persistent properties exist, I think the situations where storing the full
page tree is essential are very rare.
In terms of the stack, the back button etc -- those issues have been
discussed (see the dev list) and a comprehensive solution will probably
become a standard part of 3.1. All of those will be done in a way that will
(hopefully) not affect performance.
In any case, thank you for the good words (Howard deserves the prase here),
I hope Tapestry helps out with what you are doing.
-mb
----- Original Message -----
From: "Jonathan Locke" <jo...@muppetlabs.com>
To: <ta...@jakarta.apache.org>
Sent: Sunday, April 18, 2004 2:09 AM
Subject: page lifecycle
>
> this framework and the "Tapestry in Action" book are TOTALLY dyn-o-mite!
>
> thanks to everyone involved for (finally!) creating a truly worthwhile
> framework for doing web UIs.
> there are very few points of confusion in tapestry and really no fatal
> flaws that i can perceive.
> it's totally straightforward and component oriented in almost all aspects.
>
> unfortunately, the component model doesn't quite go as far as i'd hoped
> it would. pages *are* components. no doubt about that. but they are
> kindof temporary components that do not have an object/component-like
> meaning with respect to a session using the application. they appear
> and disappear at a page-request level granularity. this makes it
> necessary for developers to use all kinds of weird tricks like Hidden
> fields and Visit/session state to work around issues having to do with
> the browser back button. it makes more sense to me to consider all the
> pages (or at least some reasonable number of recent pages... others can
> expire) in the user's browser stack to be part of the application at any
> given moment in time. after all, the user has access to these pages.
> the pages aren't gone and so the server side components shouldn't be
either.
>
> i understand that these issues are part of a performance design decision
> to pool and reuse page objects.... but i don't agree with that decision
> entirely. for those users who would be willing to trade increased
> memory use for an even higher level of ease-of-use in the framework, i
> think the framework could allow page objects to persist throughout the
> user's session. by keeping a stack (again, with some reasonable
> developer-definable upper limit) of page objects and associating those
> with a hidden field in the rendered HTML, it would be possible for every
> page rendered to be tied back to the page object that created it. the
> stack would be adjusted based on what pages get submitted so that it
> always tracked what was in the user's browser page stack.
>
> i've implemented this sort of scheme in the past as part of a couple of
> web ui frameworks i created on different projects and it works out
> really well. with clustering and $400 emachines boxes, i find it hard
> to worry about having more first class objects around that will make my
> job far easier. as long as the feature was optional, wouldn't it be an
> improvement?
>
> comments?
>
> thanks for listening,
>
> jon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org