Skip to main content

Ryan O'Connell

Ryan O'Connell is a Staff Engineer with Sun Microsystems, Inc. Ryan works on the J2EE Compatibility Test Suite (CTS). His primary responsibilities include tools development and test harness maintenance. Before joining CTS, Ryan worked on designing and developing system management software for Sun's High End Server products. Ryan holds an M.S. in Computer Science from Boston University and a B.S. in Computer Science from the University of Central Florida.

 

ryano's blog

Implementing the State Design Pattern using Enums

Posted by ryano on January 31, 2005 at 4:14 PM PST

Recently I've been reading "Head First Design Patterns" as well as
"Java 1.5 Tiger - A Developer's Notebook". Both are really good
books by the way.  I was reading the chapter on the State design
pattern when it occurred to me that the new Enum feature in J2SE 5.0
would be a perfect way to implement the state design pattern.