From: Nick B. <ni...@co...> - 2002-07-06 21:11:08
|
Modern VMs perform better creating new objects for most types than you could do pooling them yourself. The only exceptions are objects that are spceifically I/O bound. If you don't belive me, write a contrived test to prove it to yourself. I've done it, which was the only proof I needed. > Hi Anthony > > > I checked out the extended HttpForm. That's pretty much the kind of > thing except where you cast the object > to String from the session I think it might be safer to use > > Object o = session.getAttribute(key); > String s = o.toString(); > > in order to avoid class cast problems if different classes(to String) > were stored in the session. > > Of course initially this approach will still limit one to strings and > numbers. More exciting objects would require the toString method > overriden to return a serialised form of data that could be > reconstructed in a converter object. > > The HttpForm pooling mechanism should probably be put in an extended > FormManager maybe PooledFormManager which could be a singleton > containing the pool of FormObjects wrapped in a container Object to > handle returning them to the Pool. > It shouldn't be too difficult. Jakarta have an Object Pooling project. > I'll have a look at the problem over the next week or so and get back > to you when I have a working version. > > Regards > > Nick Sanderson > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Got root? We do. > http://thinkgeek.com/sf > _______________________________________________ > FormProc-developer mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formproc-developer - /\/ -- Nick Bauman Cortexity Development Minneapolis, MN, 55412 612-232-7120 |