Dependent values and linking

John Mazzitelli mazz at redhat.com
Fri Jun 17 22:47:25 UTC 2011


On 06/17/2011 06:43 PM, Ian Springer wrote:
> 1) It seems unfortunate to not take advantage of cached configdefs for
> the 95% of configdefs that don't contain any props with dynamic options.
> Couldn't a utility method be written to determine if a configdef
> contains any dynamic option props? eg:
>
> public static boolean
> containsDynamicOptionProperties(ConfigurationDefinition configdef) {
>      for ( ... ) // recursively iterate propdefs
>        if (simplePropdef.getOptionSource() != null) {
>            return true;
>        }
>      }
>      return false;
> }
>
> The GUI config editor would call this method on each configdef and only
> request a dynamic configdef from the Server if the method returns true.

That was my suggestion on the call. I think this was agreeable to 
everyone on the call to do this.

> An optional optimization would be to cache the results of calls to
> containsDynamicOptionProperties(), either in a Map<Integer, Boolean>  or
> in a transient boolean field on the configdef itself. However, I think
> executing this method every time will still be significantly faster than
> always making the server-side call, which, besides the RPC overhead,
> will end up having to run similar code on the server side to scan the
> configdef for propdefs with option sources.

Caching bad in GWT :) We don't need to cache this anyway, as you said, 
this will be fast.


More information about the rhq-devel mailing list