On Jan 18, 2007, at 9:51 PM, Alan D. Cabrera wrote:


On Jan 18, 2007, at 7:18 PM, David Blevins wrote:


On Jan 18, 2007, at 5:47 PM, Alan D. Cabrera wrote:

I'm not a big fan of switch statements and I think that the code looks messy, jmho. Also, there's a lot more going on than just checks for illegal states. There's access to methods that needs to be controlled. Using this new paradigm, check statements and impls have sprouted all over the place. Using the "old" method, the logic/decisions are in a single place.


Easy come easy go I guess :) I will mourn the loss of the Alan code I love and learn to love the new Alan code :)

Couple design notes though. Use named inner classes (or top level classes) instead of anonymous inner classes as the Foo$3.class is hard to read in a stack trace.

Agreed. Anonymous inner classes should be restricted to teeny ones that are a few lines long, e.g. listeners.

Listeners are dangerous as anonymous inner classes since they hold an implicit reference to the outer class. This can lead to memory leaks, so use carefully.

-dain

Reply via email to