Hi,

I have some basic questions regarding best practices (or, I suppose,
intended best practices) for implementation of an IoHandler and/or
IoHandlerAdapter.  Currently, my application is following the guidelines
laid out by the tutorials, and I have a separate session handler class,
say MyServerSessionHandler, that implements IoHandler.  I then have a
singleton class to manage my server's business logic, say MyServer,
which has initialization and uninitialization methods.  In its
initialization routine, it instantiates a MyServerSessionHandler and
binds it to its IoAcceptor.

My question is fairly simple - wouldn't it perhaps make more sense for
MyServer to directly implement IoHandler, instead of containing one?

The reason I ask is because in my current implementation,
MyServerSessionHandler doesn't do much more than act as a "translator",
converting messages it receives (I'm using an
ObjectSerializationCodecFactory and custom message classes to implement
my protocol) to custom events that various components in the rest of the
application can handle independently.  But this is effectively forcing
me bind MyServerSessionHandler and MyServer fairly closely, since I am
using MyServer as the mechanism for other components to
register/unregister for my custom application events.

Or perhaps my thinking is entirely wrong, and there's generally a
better/simpler design that I should be thinking about migrating towards?
I'd appreciate any helpful suggestions here.

Thanks!

Sankalp




********************** Legal Disclaimer ****************************
"This email may contain confidential and privileged material for the sole use 
of the intended recipient.  Any unauthorized review, use or distribution by 
others is strictly prohibited.  If you have received the message in error, 
please advise the sender by reply email and delete the message. Thank you."
**********************************************************************

Reply via email to