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 non-cached
visibility (seemingly the 1% case) could override isVisibleInternal(),
but everyone else would get caching for free with their current code.

On Thu, Jan 15, 2009 at 2:35 PM, Jonathan Locke
<[email protected]> wrote:
>
>
> well, one simple design that would avoid the reuse problem is:
>
> Boolean Component#isCachedVisible() { return null; }
>
> then override to use visibility caching and return true or false.
> if you don't override you get the current functionality.
> of course you need two more bits in Component to support this...
> one for whether isCachedVisible returned non-null and another
> for the value it returned.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to