• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic