I was unsure about “how to implement constants” in the GWT client side.
I’ve seen some questions about it here on stackoverflow, such as this for example, though, it talks about the enum vs static final in Java 5, and even mentions anything about GWT.
So my question is which is the most light and/or better way to implement constants in the client side of a GWT application.
Thanks.
Of course
static finalis the more light-weight thanenum. However there is an issue with static final. If you compile a source importing a static final, then it is optimized, copied inside the class. This means that when you afterwards change the constant’s value, that is not necessarily detected (no more import, no recompilation). That does not happen with enum, and enum has more uses.static final can be placed in an Interface, and then be abbreviated.