Well, it is really not a pool per se (I never write pools anymore). I just want one instance of an arbitrary page per user-session (not per application). So, the first time the user asks for a page it is created for then put onto the session. All subsequent requests for that page would come from the cached copy in the session. This really isn't "premature optimization" as I tend to be catching a small amount for ridicule from our app server admin about the memory foot-print of my application. I have checked most of my components and pages and they really don't hold anything huge in the member fields so, I just figured I was getting a build up of pages due to people clicking around in the application. I could be wrong on that, though.
Would it help if I limit the number of page version allowed? Thanks for all the help, -scott > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:wicket-user- > [EMAIL PROTECTED] On Behalf Of Martijn Dashorst > Sent: Monday, March 19, 2007 1:06 PM > To: [email protected] > Subject: Re: [Wicket-user] Best practice for "singleton" pages > > Scott, > > You touched a 'sensitive' subject, so I expect to see several replies > here, all saying the same: > > - don't pool your pages! > > A singleton page (i.e. pooled page) is not good for your application. > First of all, it will not work in Wicket, as a page instance is > coupled to a session and pagemap. > > Second of all, it is a kind of premature optimalization that we warn > against doing in the first place. Did it come up as a hotspot? In > general, object pooling is considered an antipattern [1]. > > Please search the archives for more information on pooling of pages. > There is ample material on the list archive on this subject. > > Martijn > > [1] http://www.theserverside.com/news/thread.tss?thread_id=37146 > > On 3/19/07, Weaver, Scott <[EMAIL PROTECTED]> wrote: > > > > > > > > > > I was curious to what the best practices and approaches for using single > > instances of pages? Certain pages in my application never really change > in > > content or when they need to, are changed via an event mechanism so I > see no > > need (actually it is a disadvantage) to create a new page every time > link to > > that page. > > > > > > > > So, some questions are: > > > > - Would it make sense to implement my own version of > IPageFactory > > which could then check my session for an already existing version of the > > page? > > > > - Instead of holding the cached pages in my session, should I > > somehow use the PageMap to access existing pages? > > > > > > > > I can see a couple ways of doing things, but I am unsure of what is the > > best/standard approach for approaching this. Any suggestions will be > > greatly appreciated. > > > > > > > > Thanks, > > > > -scott > > ------------------------------------------------------------------------ > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V > > _______________________________________________ > > Wicket-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > -- > Learn Wicket at ApacheCon Europe: http://apachecon.com > Join the wicket community at irc.freenode.net: ##wicket > Wicket 1.2.5 will keep your server alive. Download Wicket now! > http://wicketframework.org > > ------------------------------------------------------------------------ - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V > _______________________________________________ > Wicket-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wicket-user ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
