Saturday, September 10, 2011

Constant classes and performance

Hi,

I recently noticed that in a GWT project, constant classes are being
defined like this:

public class Constants
{
private final Integer foo = 1;

public Integer getFoo()
{
return foo;
}
}

instead of the good ol':

public class Constants
{
public static final Integer FOO = 1;
}

When I asked, someone said this is a GWT-specific optimization. Is
this correct? If so, what optimization is that? Why is the first
version better from a performance point of view?

Thanks,
Behi

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate