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.
Also use enums instead of int constants.
Agreed. I think that I'm already doing that.
And finally, for the love of the rest of us who have to maintain
all this, try and keep all the impls in one spot if you can.
Yep. I think that we're going to end up w/ the code being in the
bean context w/ encoded references deferring access decisions to the
current bean context.
I was thinking that maybe we could wrap relevant instances obtained
from encoded references and injected instances w/ code that also
checks the current bean context. I know that the spec says that such
references are undefined when the bean is in certain states but I
think that we would be doing our users a service by throwing an
IllegalStateException rather than exhibiting bizarre behavior.
Regards,
Alan