Forums Register Login

BJO - The new Java 5 enum vs. the Type Safe Enum pattern

+Pie Number of slices to send: Send
Jacquie,

Welcome to the Ranch. I started reading your explanation about the new Java 5 enum feature. I used this recently in a small project I am working on and it seems like a slick way to easily enumerate values, just like you described in your other posts. However, I am curious why your list of "previous solutions" does not include the Typesafe Enum pattern that is commonly used in pre-1.5 code? Can you comment on how the new 1.5 enum compares with the Typesafe Enum pattern?

Thanks,

Layne
[ July 15, 2005: Message edited by: Layne Lund ]
+Pie Number of slices to send: Send
 


Can you comment on how the new 1.5 enum compares with the Typesafe Enum pattern?


The type-safe enumeration pattern was 'the inspiration' for the 1.5 enum. In fact, a 1.5 enum compiles to the same bytecode as a type-safe enum.
+Pie Number of slices to send: Send
I know the week (and the promotion) is basically over. I still would like to hear comments from the author, if she is still around.

Thanks,

Layne
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1094 times.
Similar Threads
Regarding type safe enum design pattern
pattern in java constant files
Q. related to naming convention...
Bit of Theory regarding Interfaces
Enumerations
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:02:57.