Hi, would the problem with that not be, that if the tree changes at any given time, that this would not be reflected in the singleton instance of the tree?
I suppose that I have answered the question myself!? What I was talking about was reflecting the state of the tree (catalogue) for each user in a session. The options here would be to either save the partial tree (the sections that are open) including descriptions or to simply save the last node of the tree for rebuilding it at a later stage. I suppose the fact that descriptions or availability can change really answers the question in itself! I was hoping that someone might have had some experience with this matter and could give me some tips based on this experience. The same goes with the shopping basket. The question was, saving product objects with prices, descriptions etc in a vector and retrieving them again out of the session when the user wants to have a look at what he has added into the basket. Of course, again here, if there is a threat that details or availablity may change, then there is no point in saving whole product objects in the session. This is probably also very memory consuming?! Sorry, I�m just thinking out loud in the hope that someone will cry out with something obvious! Regards, Michael ----- Original Message ----- From: "Robert Taylor" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, August 26, 2002 1:39 PM Subject: RE: Question regarding sessions > Michael, > > If the wine catalog is read only and displayed for all users, then you may > want to consider retrieving the entire tree and caching it in > javax.servlet.ServletContext. This way, you have a single instance of the > tree available to all users who at any one time may experience a different > view of the tree at the expense of a single database hit when your > application is initialized. Your users benefit from the speed at which the > tree is displayed and your system consumes less memory. > > HTH, > > robert > > > -----Original Message----- > > From: Michael Delamere [mailto:[EMAIL PROTECTED]] > > Sent: Monday, August 26, 2002 7:31 AM > > To: Struts Users Mailing List > > Subject: Question regarding sessions > > > > > > Hi, > > > > I know that this isn�t a struts specific question but I really > > could do with > > your help. And this list is a guarantee for competent answers :-) ! > > > > My question is: how much should I save in a session? > > > > Scenario: > > > > I have a catalogue with say five levels: > > > > e.g. > > alcohol > > - wines > > - red wine > > - bordeaux > > - borgougne > > - grapes bla > > - grapes blub > > - Loire > > - white wine > > - rose > > > > All of these levels are displayed as a tree on the catalogue page. The > > question I have is as follows: should I save the comlpete tree (with > > description) in the session so that I only have to retrieve a particular > > level at any given time or should I just save the state of the tree (for > > example in a state object which also contains the shopping basket and > > user_id etc), which would just consist of the last node of the tree > > (node_id)? > > > > Lets say I have put something in the shopping basket and want to > > return back > > to the tree. Should I rebuild the whole tree by asking the > > service layer to > > return the tree depending on the last node_id or should I re-display the > > tree from the session? > > > > Any help on this matter would be very appreciated because it is > > always good > > to hear opinions from others. I know that this has nothing to with struts > > but please.... > > > > Regards, > > > > Michael > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

