java enums

Hi,

Why doesn’t Vaadin use java enums instead of all these static int values? E.g. Sizeable.UNITS_* , see
https://vaadin.com/api/constant-values.html
for a full list.

I guess this is for historical reasons, but in my opinion the compile-time type checking and IDE auto-completion are well worth converting this to enums in Vaadin 7. In the rare cases that it is necessary to associate a specific integer with a value (e.g. for bit masks, or for compatibility), this is perfectly possible using enums.

(note that I haven’t looked at Vaadin 7 yet, so maybe this is already done)

Herman

Yes… in Vaadin 7 they are enums! :slight_smile:

All constants have not yet been converted to enums, but there is an ongoing effort to get them all converted before the final release of Vaadin 7.