> Hello Mark, > > Thank you for your reply and the pointers, the book indeed has > good reviews and is worth reading. > > I wanted to get a better understanding why moving sss variable > to <%session/> block turns Server Session State pattern into > Client Session State pattern.
Hello Yuri, As you explain below, it does not. > > Yes for some applications it is fine to have sss declared as a > > class or struct in a session variable (instead of the pointer). > > Then it becomes the Client Session State pattern This is incorrect, tntnet is using the Server Session State design pattern as you describe below. > I do not see the difference, from the perspective of what is > stored on client side, between > > - storing page_no in <%session/> section and looking up sss instance > in the map keyed by session number or client ip/port and > - storing sss instance in the <%session/> section and keeping > page_no inside sss itself. > > In both cases tntnet stores only a single cookie on the client side. > This cookie identifies the session. > > > Or if there is a concern about the client modifying the page_no > > session scope cookie, then the page_no could instead by stored in > > the ServerSessionState. > > tntnet does not store page_no in a cookie on the client side. It > stores it on the server side and keeps it in scope while the session > is alive. But in order to get to page_no, or any other variable > stored in the <% session/> section, tntnet has to look-up a session > scope using session identifier (sessioncookie parameter of the > ScopeManager::getSessionScope() method). > > From this perspective an extra look-up could be saved if sss > variable were stored in the <%session/> section and page_no were > placed inside sss instance. But simply moving sss variable into the > <%session/> block does not change what is stored on the client side. > > Regards, > Yuri Thanks for explaining how tntnet is using the Server Session State design pattern to implement the <%session/> section, sorry for my confusion. Thanks, Mark -- ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
