Larry, Good question. I am curious what others think about this situation as well.
On Thursday 27 May 2004 08:24 am, Zhang, Larry (L.) wrote: > It is apparent true that if the session size is big, the performance will > be negatively affected. The question is that how to actively control the > size of session. > > Let's discuss this question: > > I have a page which displays all the subordinates of a manager, for some > reasons I want to create a List or a Vector containing all the subordinates > and put this List or Vector to the session. Each element in the List or > Vector is a Java object, Employee( each Employee object has 200 String > attributes, among which 5 are needed to be displayed on the screen) > > A picture of this situation is: > > Vector allSubordinates = new Vector(); > allSubordinates.add(Employee1); > allSubordinates.add(Employee2); > ....... > > allSubordinates.add(Employee1000); > > > session.setAttribute("allSubordinates",allSubordinates); > > Do you think this actually makes the session very big? > > > Then what will be the improvement of the following? Instead of add all the > employee objects, we create a very small object called DisplayObject, which > just contains the 5 attributes required on the screen. > > Vector allSubordinates = new Vector(); > allSubordinates.add(DisplayObject1); > allSubordinates.add(DisplayObject2); > ....... > > allSubordinates.add(DisplayObject1000); > > > session.setAttribute("allSubordinates",allSubordinates); > > Your sharing of opinion is appreciated! > > Thanks. > > Larry > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]