After having worked with Swing very long I want to add that object
creation might be a performance problem in the Swing framework, but
given the time a request/response cycle takes in web-engineering
anyways it is by far preferable to have request beans in usual
situations.

You need some overhead for the request/response-cycle which you can
usually neglect, but the costs in server memory for session beans
might not be negligible.

regards,

Martin


On Fri, 11 Feb 2005 14:18:49 +0100, Matthias Wessendorf
<[EMAIL PROTECTED]> wrote:
> Sean,
> 
> thanks for your replay
> 
> Sean Schofield wrote:
> > Matthias,
> >
> > Its true that object creation can be expensive but you also have to
> > consider how often the underlying data (assuming it comes from a
> > database) changes.  In Struts you have ActionForms which are
> > essentially request scope beans (similar to but not the same as
> > backing beans).  Its no big deal constantly creating these every
> 
> sure not similar, since backing beans has more *features*
> as only being a "form-bean". Btw. scope attribute's value
> of <action/> is "session" as default.
> 
> > request.
> >
> > You also want to consider that session beans take up server memory.
> > If you have ten different backing beans for ten different pages you
> > will have ten beans sitting around in memory for each user that goes
> > through those ten pages (until the session expires.)
> 
> ah, yes good point! thanks.
> 
> > In my application we are going to have to use a lot of request scope
> > beans beacause the data needs to be up to date.  It can be changed by
> 
> That is also the thing that I wanted to do! But my co-worker said:
> "make them to session, sicne creation is VERY expensive"
> 
> --> reason for my mail
> 
> > other users at any time, so we want to show the latest on every
> > request.  In theory you could have a session bean to avoid recreating
> > the object and use a scheme to repopulate it but I am not wild about
> > that.
> 
> Ok, thanks!
> 
> I remember that Craig also allways mentioned request instead of session,
> but couldn't find a thread on that...
> 
> -Matthias
> 
> 
> > Anyways that is my .02,
> >
> > sean
> >
> >
> > On Fri, 11 Feb 2005 11:35:16 +0100, Matthias Wessendorf
> > <[EMAIL PROTECTED]> wrote:
> >
> >>Hi all,
> >>
> >>I am just on reading [1]. There is mentioned, that
> >>object creation is very expensive and you should better
> >>reuse objects instead of creating them often.
> >>
> >>Now I thought about scope of my backing beans.
> >>What should be better request or session?
> >>
> >>If I have request scoped backing beans that
> >>get often created by ONE user and I have MANY
> >>users... will request scope slow down my web app?
> >>
> >>Ok... application is also there, but that is
> >>an other stage :-) I would use such a backing
> >>bean only for *knowing* about ALL users logged
> >>into the application.
> >>
> >>[1] http://www.oreilly.com/catalog/javapt/chapter/ch04.html
> >>
> >>
> >>-Matthias
> >>
> >
> >
> 
> --
> Matthias We�endorf
> Aechterhoek 18
> DE-48282 Emsdetten
> Germany
> phone: +49-2572-9170275
> cell phone: +49-179-1118979
> email: matzew AT apache DOT org
> url: http://www.wessendorf.net
> callto://mwessendorf (Skype)
> icq: 47016183
> 
> --
> Matthias We�endorf
> Aechterhoek 18
> DE-48282 Emsdetten
> Germany
> phone: +49-2572-9170275
> cell phone: +49-179-1118979
> email: matzew AT apache DOT org
> url: http://www.wessendorf.net
> callto://mwessendorf (Skype)
> icq: 47016183
>

Reply via email to