Friday, September 24, 2010

Beautiful Java Enums

File under “It’s never too late to blog about Java 5 features” and “you wrote 1000 words on what?”.

Way back before Java 5 I fell in love with the Type Safe Enum pattern described in Martin Fowler’s Refactoring. You know the one, where an instance of a class has members of itself as public static fields. It was so clever (not always a compliment) and I applied it everywhere I could. Fowler’s example dealt with blood types... to read the full article surf over to http://canoo.com/blog/2010/09/24/beautiful-java-enums/


And don't forget to spread a little DZone love...

No comments: