will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-27 Thread Jason Wang
Hi all, Although I am using spring-wicket to prevent the whole spring being serialized, It still brothers me to see the references in the model object, for example: Instead of using this: public class MyViewObjectProvider extends SortableDataProvider{ @SpringBean("daoService") pr

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-27 Thread Murat Yücel
Hi Jason I dont have a performance comparison, but i cannot see why you should gain better performance. All spring beans are as default singleton, so you will just forward a singleton using a singleton. /Murat 2009/7/28 Jason Wang : > Hi all, > > Although I am using spring-wicket to prevent the

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Wilko Hische
------ > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/will-there-be-a-performance-gain-to-use-singl

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Eelco Hillenius
It might give you a very slight edge to use a singleton as you (or the annotation processor in this case) don't have to introspect and work through a proxy. If you're not bothered by singletons (I, for one typically are): go for it. However, keep that famous 'premature optimization is the root of a

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Eelco Hillenius
Actually, thinking about it, if you're very tight on memory, it will save you a reference, particularly when the page gets serialized. So if you are worrying about efficiency *and* are ok with this code style, it's an option. :-) Eelco On Tue, Jul 28, 2009 at 12:47 AM, Eelco Hillenius wrote: > It

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Martijn Dashorst
There's the risk of keeping the retrieved service as a reference somewhere, e.g. by declaring it final and using it inside an anon inner class, negating any and all gains you've done by using the static lookup. The @SpringBean annotated references are safe to pass around (as they are implemented as

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Igor Vaynberg
also safe to do with salve because it removes the field and rewrites field reads with lookups. wicket-spring and salve were created for a reason - to make it easy to work with services in an environment where objects are often serialized. salve doesnt have the memory overhead of wicket's @SpringB

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Marat Radchenko
Don't guess, profile it. 2009/7/28 Jason Wang : > Hi all, > > Although I am using spring-wicket to prevent the whole spring being > serialized, It still brothers me to  see the  references in the model > object, for example: > > Instead of using this: > > public class MyViewObjectProvider extends

Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Jason Wang
Hi Martijin, Thats a very good point. I definitely overlooked that risk before. Thank you for pointing it out! Thanks, Jason Wang Martijn Dashorst wrote: There's the risk of keeping the retrieved service as a reference somewhere, e.g. by declaring it final and using it inside an anon inner