On Wednesday, June 26, 2002, 12:31:11 PM, Craig wrote:

CRM> * Do not store complete data structures that are large and complex,
CRM>   unless they really represent shared application data (in which case
CRM>   they should probably be in the servlet context attributes instead).

CRM> * Hide the caching choice you are making inside the get methods of your
CRM>   user object, so you can change your mind later without modifying all
CRM>   the code that uses the data.

       I know this is probably a pretty newbie question, but...
       How is it different storing something in the servlet context vs
       having a static member in a class that is only loaded once
       when null? In other words I'm tending to use your second
       approach above, where say I need a list of StoreBeans I call a
       getStores() from a Commons class that first checks if the
       StoresList is null, and if it is null it loads them up.

       Am I correct in assuming that subsequent requests by ANY other
       session to the getStores() method will not load them up once
       any session has called the method? If that assumption is
       correct, is the only difference then in storing a List in the
       servlet context a matter of being able to use the List on any
       JSP page without having to set it there first in some action
       class (as you would have to do with a List you got from a
       getStores() method in some class)?

       Thanks for the help
       Rick


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to