You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Jouravlev <jm...@gmail.com> on 2006/07/22 22:07:50 UTC

FlashScope: anyone has a better name?

FlashScope is a feature of such frameworks like Tapestry or Stripes.
Behind the scenes, it uses session object and automatically retains
objects for the duration of this request and the subsequent request.
This scope object works best when redirect-after-post pattern is
utilized.

Struts has a rudimentary implementation of this tecnhique for handling
messages and errors. If a more generic FlashScope were created for
Struts, what do you call it:

* Drop scope -- this one sounds nice to me
* Autodiscard scope -- this explains that it is cleaned up automatically
* Roundtrip scope -- this explains what is it for
* Castaway scope
* Hold scope
* JettiScope (from "jettison", but may seem related to Jetty server)
* Just call it FlashScope like in Stripes
* Nah, FlashScope has Macromedia smell, should be something different,
like ____ (suggest yours)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Antonio Petrelli <br...@tariffenet.it>.
Michael Jouravlev ha scritto:
> Struts has a rudimentary implementation of this tecnhique for handling
> messages and errors. If a more generic FlashScope were created for
> Struts, what do you call it:

Consider "click" scope, though it smells like a client point-of-view.

Just my 2 eurocents
Antonio


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[OT] Re: FlashScope: anyone has a better name?

Posted by Antonio Petrelli <br...@tariffenet.it>.
Adam Hardy ha scritto:
>
> Antonio,
> what is 'anhemic' programming? It's not in dictionary.com.

Yes, well it's "anemic" but I forgot to correct it! :-P

>
> Your text on sourceforge says 'See "[put pattern name]" for 
> reference;' but I can't see the link. (is that some resource filter 
> that didn't work during your deploy?)

In fact I am thinking about a design pattern, but maybe no pattern at 
all is needed (just because I am thinking about integration in Spring). 
Notice that Scopes is still in 0.0.2 stage and I wanted only to present 
my "idea", not the software itself.
Anyway, if you have more questions, please post them to the mailing 
list, or mail me privately, I don't think that Struts people are so 
happy with this off-topic questions.

Ciao
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Antonio Petrelli on 24/07/06 08:48, wrote:
> David Friedman ha scritto:
>> Why not call them custom scopes and link it into to contexts where
>> appropriate.  That way you could name your scope and if it doesn't exist,
>> create it.  Then you could have generic methods to handle all sorts of
>> scopes at once with generic methods like:
>>
>> addScope("request").setAttribute(name, object);
>> addScope("session").setAttribute(name, object);
>> addScope("single").setAttribute(name, object);
>> addScope("someDialog").setAttribute(name, object);
>>   
> 
> Ehm, cough cough:
> http://scopes.sourceforge.net/
> 
> Does it interest anyone?


Antonio,
what is 'anhemic' programming? It's not in dictionary.com.

Your text on sourceforge says 'See "[put pattern name]" for reference;' but I 
can't see the link. (is that some resource filter that didn't work during your 
deploy?)



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: FlashScope: anyone has a better name?

Posted by David Friedman <hu...@ix.netcom.com>.
Great minds think alike. :)  And no, I didn't even know about that project -
I guess certain needs are universal.    Kudos on using the Apache 2.0
license.

<rant>
Too bad Jackasses in the US Patent Office allow ideas this to be patented
when many people can come to the same conclusions as well as create them.
</rant>

Regards,
David

-----Original Message-----
From: Antonio Petrelli [mailto:brenmcguire@tariffenet.it]
Sent: Monday, July 24, 2006 3:49 AM
To: Struts Users Mailing List
Subject: Re: FlashScope: anyone has a better name?


David Friedman ha scritto:
> Why not call them custom scopes and link it into to contexts where
> appropriate.  That way you could name your scope and if it doesn't exist,
> create it.  Then you could have generic methods to handle all sorts of
> scopes at once with generic methods like:
>
> addScope("request").setAttribute(name, object);
> addScope("session").setAttribute(name, object);
> addScope("single").setAttribute(name, object);
> addScope("someDialog").setAttribute(name, object);
>

Ehm, cough cough:
http://scopes.sourceforge.net/

Does it interest anyone?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Antonio Petrelli <br...@tariffenet.it>.
David Friedman ha scritto:
> Why not call them custom scopes and link it into to contexts where
> appropriate.  That way you could name your scope and if it doesn't exist,
> create it.  Then you could have generic methods to handle all sorts of
> scopes at once with generic methods like:
>
> addScope("request").setAttribute(name, object);
> addScope("session").setAttribute(name, object);
> addScope("single").setAttribute(name, object);
> addScope("someDialog").setAttribute(name, object);
>   

Ehm, cough cough:
http://scopes.sourceforge.net/

Does it interest anyone?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: FlashScope: anyone has a better name?

Posted by David Friedman <hu...@ix.netcom.com>.
Why not call them custom scopes and link it into to contexts where
appropriate.  That way you could name your scope and if it doesn't exist,
create it.  Then you could have generic methods to handle all sorts of
scopes at once with generic methods like:

addScope("request").setAttribute(name, object);
addScope("session").setAttribute(name, object);
addScope("single").setAttribute(name, object);
addScope("someDialog").setAttribute(name, object);

Where a scope is created if the name doesn't already exist. Except that in
the "request" or "session" names, it automatically hooks into those scopes
for consistency.  And for the Stripes equivalent "Flash" scope just call it
"single" scope or "next" scope.  Basically that means you can name dialogs
of your choice plus have multiple ones.   If they are linked to the Session
context then they'll auto-expire if left too long.  Plus, we could add
something that enables scopes for a maximum number of requests (via a filter
perhaps) if that is a requirement, allowing a sort of auto-flush for these
potentially expired less-than-session scopes.

Regards,
David

-----Original Message-----
From: Adam Hardy [mailto:ahardy.struts@cyberspaceroad.com]
Sent: Saturday, July 22, 2006 5:09 PM
To: Struts Users Mailing List
Subject: Re: FlashScope: anyone has a better name?


FlashScope definitely smells of Macromedia.

Spring Webflow has several scopes in the virtual scope-scape between request
scope and session scope, called ConversationScope and FlowScope.

Perhaps they are more to your taste?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
FlashScope definitely smells of Macromedia. 

Spring Webflow has several scopes in the virtual scope-scape between request scope and session scope, called ConversationScope and FlowScope.

Perhaps they are more to your taste?


Michael Jouravlev on 22/07/06 21:20, wrote:
> Umm, dialog is not really the same thing:
> 
> http://shale.apache.org/features-dialog-manager.html
> "Conceptually, a dialog can be thought of as a set of labelled states,
> connected by labelled transitions between those states."
> 
> I am talking about something like this but more generic:
> 
>    /**
>     * <p>Removes any <code>ActionMessages</code> object stored in the 
> session
>     * under <code>Globals.MESSAGE_KEY</code> and
> <code>Globals.ERROR_KEY</code>
>     * if the messages' <code>isAccessed</code> method returns true.  This
>     * allows messages to be stored in the session, display one time, and be
>     * released here.</p>
>     *
>     * @param request The servlet request we are processing.
>     * @param response The servlet response we are creating.
>     *
>     * @since Struts 1.2
>     */
>    protected void processCachedMessages(
> 
>        HttpServletRequest request,
>        HttpServletResponse response) {
> 
>        HttpSession session = request.getSession(false);
>        if (session == null) {
>            return;
>        }
> 
>        // Remove messages as needed
>        ActionMessages messages =
>            (ActionMessages) session.getAttribute(Globals.MESSAGE_KEY);
> 
>        if (messages != null) {
>            if (messages.isAccessed()) {
>                session.removeAttribute(Globals.MESSAGE_KEY);
>            }
>        }
> 
>        // Remove error messages as needed
>        messages = (ActionMessages) session.getAttribute(Globals.ERROR_KEY);
> 
>        if (messages != null) {
>            if (messages.isAccessed()) {
>                session.removeAttribute(Globals.ERROR_KEY);
>            }
>        }
> 
>    }
> 
> Looking at the method's name, I might think of:
> 
> * Bean cache
> * Cache scope
> 
> On 7/22/06, Paul Benedict <pa...@yahoo.com> wrote:
>> Shale calls this a dialog. I prefer that name. The reason is, 
>> obviously, is a continuous dialog across multiple requests.
>>
>> Michael Jouravlev <jm...@gmail.com> wrote: FlashScope is a feature of 
>> such frameworks like Tapestry or Stripes.
>> Behind the scenes, it uses session object and automatically retains
>> objects for the duration of this request and the subsequent request.
>> This scope object works best when redirect-after-post pattern is
>> utilized.
>>
>> Struts has a rudimentary implementation of this tecnhique for handling
>> messages and errors. If a more generic FlashScope were created for
>> Struts, what do you call it:
>>
>> * Drop scope -- this one sounds nice to me
>> * Autodiscard scope -- this explains that it is cleaned up automatically
>> * Roundtrip scope -- this explains what is it for
>> * Castaway scope
>> * Hold scope
>> * JettiScope (from "jettison", but may seem related to Jetty server)
>> * Just call it FlashScope like in Stripes
>> * Nah, FlashScope has Macromedia smell, should be something different,
>> like ____ (suggest yours)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Michael Jouravlev <jm...@gmail.com>.
Umm, dialog is not really the same thing:

http://shale.apache.org/features-dialog-manager.html
"Conceptually, a dialog can be thought of as a set of labelled states,
connected by labelled transitions between those states."

I am talking about something like this but more generic:

    /**
     * <p>Removes any <code>ActionMessages</code> object stored in the session
     * under <code>Globals.MESSAGE_KEY</code> and
<code>Globals.ERROR_KEY</code>
     * if the messages' <code>isAccessed</code> method returns true.  This
     * allows messages to be stored in the session, display one time, and be
     * released here.</p>
     *
     * @param request The servlet request we are processing.
     * @param response The servlet response we are creating.
     *
     * @since Struts 1.2
     */
    protected void processCachedMessages(

        HttpServletRequest request,
        HttpServletResponse response) {

        HttpSession session = request.getSession(false);
        if (session == null) {
            return;
        }

        // Remove messages as needed
        ActionMessages messages =
            (ActionMessages) session.getAttribute(Globals.MESSAGE_KEY);

        if (messages != null) {
            if (messages.isAccessed()) {
                session.removeAttribute(Globals.MESSAGE_KEY);
            }
        }

        // Remove error messages as needed
        messages = (ActionMessages) session.getAttribute(Globals.ERROR_KEY);

        if (messages != null) {
            if (messages.isAccessed()) {
                session.removeAttribute(Globals.ERROR_KEY);
            }
        }

    }

Looking at the method's name, I might think of:

* Bean cache
* Cache scope

On 7/22/06, Paul Benedict <pa...@yahoo.com> wrote:
> Shale calls this a dialog. I prefer that name. The reason is, obviously, is a continuous dialog across multiple requests.
>
> Michael Jouravlev <jm...@gmail.com> wrote: FlashScope is a feature of such frameworks like Tapestry or Stripes.
> Behind the scenes, it uses session object and automatically retains
> objects for the duration of this request and the subsequent request.
> This scope object works best when redirect-after-post pattern is
> utilized.
>
> Struts has a rudimentary implementation of this tecnhique for handling
> messages and errors. If a more generic FlashScope were created for
> Struts, what do you call it:
>
> * Drop scope -- this one sounds nice to me
> * Autodiscard scope -- this explains that it is cleaned up automatically
> * Roundtrip scope -- this explains what is it for
> * Castaway scope
> * Hold scope
> * JettiScope (from "jettison", but may seem related to Jetty server)
> * Just call it FlashScope like in Stripes
> * Nah, FlashScope has Macromedia smell, should be something different,
> like ____ (suggest yours)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Monkeyden <mo...@gmail.com>.
I agree with Paul (and Shale).  Dialog, or even "Conversation", scope makes
the most sense.  It's exactly as descript as it needs to be.  If you can't
figure out what it means than you probably shouldn't venture out of page
scope.

On 7/22/06, Paul Benedict <pa...@yahoo.com> wrote:
>
> Shale calls this a dialog. I prefer that name. The reason is, obviously,
> is a continuous dialog across multiple requests.
>
> Michael Jouravlev <jm...@gmail.com> wrote: FlashScope is a feature of
> such frameworks like Tapestry or Stripes.
> Behind the scenes, it uses session object and automatically retains
> objects for the duration of this request and the subsequent request.
> This scope object works best when redirect-after-post pattern is
> utilized.
>
> Struts has a rudimentary implementation of this tecnhique for handling
> messages and errors. If a more generic FlashScope were created for
> Struts, what do you call it:
>
> * Drop scope -- this one sounds nice to me
> * Autodiscard scope -- this explains that it is cleaned up automatically
> * Roundtrip scope -- this explains what is it for
> * Castaway scope
> * Hold scope
> * JettiScope (from "jettison", but may seem related to Jetty server)
> * Just call it FlashScope like in Stripes
> * Nah, FlashScope has Macromedia smell, should be something different,
> like ____ (suggest yours)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Groups are talking. We´re listening. Check out the handy changes to Yahoo!
> Groups.
>

Re: FlashScope: anyone has a better name?

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
How about ContinuationScope?  Sounds decent to me since the second 
request can be viewed as a continuation of the first.

Then again, if other frameworks are calling a similar facility 
FlashScope, then there is some logic in using that name as well... that 
way, when people compare frameworks, they can see that Struts isn't 
lacking this as compared to other frameworks.

Incidentally, can you elaborate on how Struts supports this now?  I'm 
not sure I'm aware of this...

Frank

Paul Benedict wrote:
> Shale calls this a dialog. I prefer that name. The reason is, obviously, is a continuous dialog across multiple requests.
> 
> Michael Jouravlev <jm...@gmail.com> wrote: FlashScope is a feature of such frameworks like Tapestry or Stripes.
> Behind the scenes, it uses session object and automatically retains
> objects for the duration of this request and the subsequent request.
> This scope object works best when redirect-after-post pattern is
> utilized.
> 
> Struts has a rudimentary implementation of this tecnhique for handling
> messages and errors. If a more generic FlashScope were created for
> Struts, what do you call it:
> 
> * Drop scope -- this one sounds nice to me
> * Autodiscard scope -- this explains that it is cleaned up automatically
> * Roundtrip scope -- this explains what is it for
> * Castaway scope
> * Hold scope
> * JettiScope (from "jettison", but may seem related to Jetty server)
> * Just call it FlashScope like in Stripes
> * Nah, FlashScope has Macromedia smell, should be something different,
> like ____ (suggest yours)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
>  		
> ---------------------------------
> Groups are talking. We&acute;re listening. Check out the handy changes to Yahoo! Groups. 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: FlashScope: anyone has a better name?

Posted by Paul Benedict <pa...@yahoo.com>.
Shale calls this a dialog. I prefer that name. The reason is, obviously, is a continuous dialog across multiple requests.

Michael Jouravlev <jm...@gmail.com> wrote: FlashScope is a feature of such frameworks like Tapestry or Stripes.
Behind the scenes, it uses session object and automatically retains
objects for the duration of this request and the subsequent request.
This scope object works best when redirect-after-post pattern is
utilized.

Struts has a rudimentary implementation of this tecnhique for handling
messages and errors. If a more generic FlashScope were created for
Struts, what do you call it:

* Drop scope -- this one sounds nice to me
* Autodiscard scope -- this explains that it is cleaned up automatically
* Roundtrip scope -- this explains what is it for
* Castaway scope
* Hold scope
* JettiScope (from "jettison", but may seem related to Jetty server)
* Just call it FlashScope like in Stripes
* Nah, FlashScope has Macromedia smell, should be something different,
like ____ (suggest yours)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



 		
---------------------------------
Groups are talking. We&acute;re listening. Check out the handy changes to Yahoo! Groups.