You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Rodrigo Reyes <ro...@instaservi.com> on 2003/05/31 17:42:39 UTC

Statefull actions...

Hi
    I have been using Turbine for a while. I like the way we can create
actions and even more, the way we could have one action store multiple
events.
    Still, actions are stateless. We could place information on the client
about the state of a page, or we could even place it on the session. But if
we place it on the session, then we need some SessionValidator (I think) in
order to have under control which information remains and which doesn't (I
am not sure about this, so please correct me if I'm wrong).
    So I have been thinking: what if an action (and here I am talking about
actions which handle multiple events) were statefull? Something like this:
If you call an action for the first time, it gets instantiated and when its
execution finishes, it gets stored in the session. Next time it is called,
the instance which was stored in the session is used, so if you had instance
variables defined, you will find them exactly as you left them the last
time.
    How many different actions would be stored at the same time? It would be
up to the programmer. We should provide an API for him to control the
actions stored. I think we could even let him/her control what happens if
the user tries to execute a new action, while he was in the middle of
something important on the last action.
    Maybe I am just reinventing the wheel here. Please, let me know what you
think.

Rodrigo




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Statefull actions...

Posted by "Jeffrey D. Brekke" <jb...@brekke.org>.
Use pull tools, in your case specifically a session level pull tool.
Basically a session level pull tool is a java object that is stored in
the users session and actions and templates have access to it.


>>>>> On Sat, 31 May 2003 10:42:39 -0500, "Rodrigo Reyes" <ro...@instaservi.com> said:

> Hi I have been using Turbine for a while. I like the way we can
> create actions and even more, the way we could have one action store
> multiple events.  Still, actions are stateless. We could place
> information on the client about the state of a page, or we could
> even place it on the session. But if we place it on the session,
> then we need some SessionValidator (I think) in order to have under
> control which information remains and which doesn't (I am not sure
> about this, so please correct me if I'm wrong).  So I have been
> thinking: what if an action (and here I am talking about actions
> which handle multiple events) were statefull? Something like this:
> If you call an action for the first time, it gets instantiated and
> when its execution finishes, it gets stored in the session. Next
> time it is called, the instance which was stored in the session is
> used, so if you had instance variables defined, you will find them
> exactly as you left them the last time.  How many different actions
> would be stored at the same time? It would be up to the
> programmer. We should provide an API for him to control the actions
> stored. I think we could even let him/her control what happens if
> the user tries to execute a new action, while he was in the middle
> of something important on the last action.  Maybe I am just
> reinventing the wheel here. Please, let me know what you think.

> Rodrigo




> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org