In my opinion, state machines are not only good but required on some contexts.
The problem is how good you implement it. The MINA wiki has a tutorial explaining the mina-sm component and that was something that (again, in my opinion) was too complex. Maybe a little rethinking on how mina-sm does things is needed (or maybe a cleaner way to indicate states). States are known to be troublesome to implement if you don't know them well, and in Java you will see most likely a class that implements the states as internal subclasses. So yes, states are sticky things, but if you do it carefully and with good thinking, it makes code maintainability a snap. Just my opinion. Rodrigo On 7/25/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
Hi community, I found an interesting thread related with MINA: http://www.javalobby.org/java/forums/t99219.html Mike Heath is evangelizing MINA in the thread. I really appreciate his effort, and let's hope more users are interested in MINA. Thanks, Mike! :) Anyways, I'd like to ask you a question; does state machine hurt code readibility and maintainability? From my experience, state machine and event-driven paradigm simplifies implementation of protocols dramatically. I also find well-designed state machine will not hurt code readability: https://svn.safehaus.org/repos/asyncweb/trunk/core/src/main/java/org/safehaus/asyncweb/codec/decoder/HttpRequestDecodingState.java I personally think it's a matter of familiarness. I have been using state machines and event driven model for more than 3 years, and that might be making me very comfortable with them. WDYT? Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
