overriding isVisible bad?

2010-11-29 Thread Douglas Ferguson
Igor posted a comment to this bug saying that overriding isVisible() is evil https://issues.apache.org/jira/browse/WICKET-3171 I was surprised by this and am curious to hear more. D/

Re: overriding isVisible bad?

2010-11-29 Thread Martin Grigorov
The recommended way since a few 1.4 releases is to override onConfigure() and call setVisible(true|false) depending on your conditions. On Mon, Nov 29, 2010 at 4:49 PM, Douglas Ferguson doug...@douglasferguson.us wrote: Igor posted a comment to this bug saying that overriding isVisible() is

Re: overriding isVisible bad?

2010-11-29 Thread Douglas Ferguson
Can you explain why? We have done this all over the place. D/ On Nov 29, 2010, at 10:00 AM, Martin Grigorov wrote: The recommended way since a few 1.4 releases is to override onConfigure() and call setVisible(true|false) depending on your conditions. On Mon, Nov 29, 2010 at 4:49 PM,

Re: overriding isVisible bad?

2010-11-29 Thread Sven Meier
Hi Douglas, WICKET-3171 describes a problematic case, where visibility of a component changes while its form is being processed. In our projects we're overriding isVisible() where appropriate and never encountered a similar problem. I'd say WICKET-3171 is the rare 5% usecase. What's next, is

Re: overriding isVisible bad?

2010-11-29 Thread Eelco Hillenius
Niether is evil. It has potential pitfalls, which you should just be aware of. We use such overrides all over the place and never have problems with them either. :-) Avoiding it is safer, but also more verbose (in 1.3.x at least). Eelco On Mon, Nov 29, 2010 at 9:49 AM, Igor Vaynberg

Re: overriding isVisible bad?

2010-11-29 Thread Eelco Hillenius
To expand, unless I'm missing something (new?), things are really only problematic when both the mutable value and the override are mixed. In a way, I think that using the override is 'more pure', as it's a simple function that is executed when needed, whereas mutable state can be harder to deal

Re: overriding isVisible bad?

2010-11-29 Thread Igor Vaynberg
ive run into plenty of weird problems with overrides, but maybe because this was in a high concurrency app where data changed frequently. the problems arise from the fact that the value returned from isvisible() can change while we are doing traversals, etc. eg we run a traversal for all visible

Re: overriding isVisible bad?

2010-11-29 Thread Igor Vaynberg
how so? we added something new that we think will work better. -igor On Mon, Nov 29, 2010 at 12:45 PM, James Carman ja...@carmanconsulting.com wrote: On Mon, Nov 29, 2010 at 1:13 PM, Eelco Hillenius eelco.hillen...@gmail.com wrote: Niether is evil. It has potential pitfalls, which you should

Re: overriding isVisible bad?

2010-11-29 Thread James Carman
I am glad we have something new that's better, but going from do this to this is evil is the troubling part. A lot of us have a lot of code that is based on the previous advice. Now declaring that code is evil is kind of scary, especially in the middle of a major version. If something is evil,

Re: overriding isVisible bad?

2010-11-29 Thread Igor Vaynberg
if it works for you keep it. all we did was give you a better/safer alternative. -igor On Mon, Nov 29, 2010 at 12:59 PM, James Carman ja...@carmanconsulting.com wrote: I am glad we have something new that's better, but going from do this to this is evil is the troubling part.  A lot of us have

Re: overriding isVisible bad?

2010-11-29 Thread Eelco Hillenius
Well, in the past, the canned answer was override isEnabled/isVisible.  Changing that paradigm and doing a complete 180 is troubling. I don't think that's the case though. We've had many discussions on this list (and in private even), and we've always felt uneasy about supporting two rather

Re: overriding isVisible bad?

2010-11-29 Thread richard emberson
If wicket was going to be coded over again, would you make isEnabled and/or isVisible final methods? Might the non-finality of the methods be deprecated in some future release? The majority of the isXXX methods in Component are final. Richard -- Quis custodiet ipsos custodes

Re: overriding isVisible bad?

2010-11-29 Thread Eelco Hillenius
it has nothing to do with requiring a function to be set. the problem is that the function is free to change its mind at any moment, but we rely on it returning the same value during some fixed periods of time. if we truly want to support isvisible() we would need to cache/memoize the value

Re: overriding isVisible bad?

2010-11-29 Thread Eelco Hillenius
On Mon, Nov 29, 2010 at 7:45 PM, richard emberson richard.ember...@gmail.com wrote: If wicket was going to be coded over again, would you make isEnabled and/or isVisible final methods? If *I* would do it, I'd probably write it for Scala and lean more heavily on functions rather than mutable

Re: overriding isVisible bad?

2010-11-29 Thread Juergen Donnerstag
I'm curious. Which ideas would you steal from SiteBricks and JaxRS? Juergen On Tue, Nov 30, 2010 at 5:51 AM, Eelco Hillenius eelco.hillen...@gmail.com wrote: On Mon, Nov 29, 2010 at 7:45 PM, richard emberson richard.ember...@gmail.com wrote: If wicket was going to be coded over again, would