Re: Re: Why you should not override isVisible

2009-01-16 Thread sven
What's taking so long in your isVisible() method? The model object should be cached, and is isPositive() so expensive? Sven - Ursprüngliche Nachricht - Von: Scott Swank Gesendet: 16.01.09 02:06 Uhr An: users@wicket.apache.org Betreff: Re: Why you should not override isVisible

Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten
Martijn, I just went through the source (1.4-rc1) to trace a detach manually and find suspect callers of isVisible. I found none during detach, but I did find one call to isVisible /after/ detach. A simple run confirmed this. The call to isVisible /after/ detach can be found in method

Re: Why you should not override isVisible

2009-01-16 Thread DVD
. Sorry I could not provide sample to reproduce this. but I did see it happening. - Original Message - From: Erik van Oosten e.vanoos...@grons.nl To: users@wicket.apache.org Sent: Friday, January 16, 2009 4:18 AM Subject: Re: Why you should not override isVisible Martijn, I just went

Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten
Thanks DVD, we already established that it is called more then once. This discussion is talking about: 1. caching the visible value during the render phase to prevent the potentially large performance hit of multiple invocations to isVisible 2. preventing calls to isVisible during or

Re: Re: Why you should not override isVisible

2009-01-16 Thread Michael Sparer
be cached, and is isPositive() so expensive? Sven - Ursprüngliche Nachricht - Von: Scott Swank Gesendet: 16.01.09 02:06 Uhr An: users@wicket.apache.org Betreff: Re: Why you should not override isVisible We have implemented this, perhaps a dozen times or more

Re: Why you should not override isVisible

2009-01-16 Thread sven
Ok, IMHO it's a bug that wicket calls isVisible() after detachment. Thus caching isVisible() is not needed. Sven - Ursprüngliche Nachricht - Von: Michael Sparer Gesendet: 16.01.09 11:20 Uhr An: users@wicket.apache.org Betreff: Re: Re: Why you should not override isVisible

RE: Why you should not override isVisible

2009-01-16 Thread Hoover, William
+1 -Original Message- From: s...@meiers.net [mailto:s...@meiers.net] Sent: Friday, January 16, 2009 7:47 AM To: users@wicket.apache.org Subject: Re: Why you should not override isVisible Ok, IMHO it's a bug that wicket calls isVisible() after detachment. Thus caching isVisible

Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten
Please don't turn the logic around. Caching is only needed because isVisible can be a performance hit. /If/ you want caching /then/ isVisible should not be called after detach as detach is needed to clear the cache. Regards, Erik. s...@meiers.net wrote: Ok, IMHO it's a bug that wicket

Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten
Sorry Sven, You of course meant to say: /If/ isVisible would no longer be called after detach /then/ it would be possible to do the caching yourself (as you can use detach to clear the cache). /If/ you can cache yourself /then/ Wicket does not need to cache the result of isVisible.

Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten
Created an issue: http://issues.apache.org/jira/browse/WICKET-2025 Regards, Erik. Erik van Oosten wrote: Martijn, I just went through the source (1.4-rc1) to trace a detach manually and find suspect callers of isVisible. I found none during detach, but I did find one call to isVisible

Re: Re: Why you should not override isVisible

2009-01-16 Thread Scott Swank
Betreff: Re: Why you should not override isVisible We have implemented this, perhaps a dozen times or more across our application. For example, there are several payment options whose relevance is determined by whether the customer owes any money on their purchase (e.g. as opposed to using

Re: Why you should not override isVisible

2009-01-16 Thread Sven Meier
@wicket.apache.org Betreff: Re: Why you should not override isVisible We have implemented this, perhaps a dozen times or more across our application. For example, there are several payment options whose relevance is determined by whether the customer owes any money on their purchase (e.g. as opposed

Re: Why you should not override isVisible

2009-01-16 Thread Scott Swank
Gesendet: 16.01.09 02:06 Uhr An: users@wicket.apache.org Betreff: Re: Why you should not override isVisible We have implemented this, perhaps a dozen times or more across our application. For example, there are several payment options whose relevance is determined by whether the customer owes

Why you should not override isVisible

2009-01-15 Thread Erik van Oosten
In the thread Where to process PageParameters I was requested to explain why I think you should not override isVisible, but rather should call setVisible in onBeforeRender (slide 100 in my presentation http://www.grons.nl/~erik/pub/20081112%20Effective%20Wicket.pdf). There are 2 reasons, but

Re: Why you should not override isVisible

2009-01-15 Thread Martin Makundi
-1- isVisible is called a lot. It is easily called ten times within 1 request If you need to optimize, you can use lazy initialization of a boolean variable here and reset it in onBeforeRender? -2- isVisible can make your model be reloaded multiple times within 1 request If you need to

Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
We have done exact that -- a lot. Driving isVisible() from the state of the model is very clean, but the performance is potentially awful. I have wondered whether this should be the default implementation for Component.isVisible(). Is IVisitor.beforeRender() an appropriate place in the rendering

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Martin Makundi
/ - 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/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
-- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr

Re: Why you should not override isVisible

2009-01-15 Thread Martin Makundi
...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
- 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/Why-you-should-not-override-isVisible

Re: Why you should not override isVisible

2009-01-15 Thread Erik van Oosten
Hi Pierre, I actually thought they were in English, but I now see that the first few are in Dutch. Not sure why I did that. They are not that important, so just read on... Regards, Erik. Pierre Goupil wrote: Good evening, I'm sorry to bug you, but I'be read the presentation you're

Re: Why you should not override isVisible

2009-01-15 Thread Martijn Dashorst
/ - 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/Why-you-should-not-override-isVisible

Re: Why you should not override isVisible

2009-01-15 Thread Erik van Oosten
Indeed. If this would no longer be the case, overriding isVisible would be no problem (though caching would be nice). Regards, Erik. Martijn Dashorst wrote: What is strange is that isvisible is being checked during detach (I seriously doubt that). That shouldn't be happening: *all*

Re: Why you should not override isVisible

2009-01-15 Thread Martijn Dashorst
On Thu, Jan 15, 2009 at 9:38 PM, Erik van Oosten e.vanoos...@grons.nl wrote: I actually thought they were in English, but I now see that the first few are in Dutch. Not sure why I did that. They are not that important, so just read on... You can probably have a good laugh at google translate

Re: Why you should not override isVisible

2009-01-15 Thread Igor Vaynberg
...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands

Re: Why you should not override isVisible

2009-01-15 Thread Martijn Dashorst
/ - 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/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
My idea what an inversion of that one: Add a method to Component, such as isVisibleInternal() [no I don't love the name] that would cache the results of isVisible(). Then all code that currently calls isVisible() would be changed to call isVisibleInternal() instead. Someone who really wanted

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21490448.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: Why you should not override isVisible

2009-01-15 Thread Jonathan Locke
this message in context: http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21490479.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org

Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
. - 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/Why-you-should-not-override-isVisible-tp21474995p21490479.html Sent from the Wicket - User mailing list archive

Re: Why you should not override isVisible

2009-01-15 Thread Martin Makundi
/ - 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/Why-you-should-not-override-isVisible-tp21474995p21483816.html Sent from the Wicket - User mailing