I thought about the current MINA API these days while I am idle, and got
some idea of improvements:

1) Split IoBuffer into two parts - array and buffer

IoBuffer is basically an improvement to ByteBuffer.  Improvement here
means it inherited some bad asset from ByteBuffer - all the stateful
properties such as position, limit and mark.  I think they should be
provided as a separate class, and there should be classes dedicated for
storing bytes only (something like ByteArray?)

BTW, why is mixing them a bad idea?  It's because it makes the
implementation too complicated.  For example, it is almost impossible to
implement a composite buffer to support close-to-zero-copy I/O.  What
about all the weird rules related with auto-expansion and buffer
derivation?  It's increasing the learning curve.

2) Get rid of IoHandler and let IoFilter replace it.

IoHandler is just a special IoFilter at the end of the filter chain.  I
don't see any reason to keep it special considering that we are often
building multi-layered protocols.

3) Split IoFilter into multiple interfaces.

If IoHandler is removed, IoFilter should be renamed to represent itself
better.  Moreover, IoFilter should be split into more than one interface
 (e.g. UpstreamHandler for receiving events and DownstreamHandler for
sending events from/to an IoProcessor) so they can choose what to
override more conveniently.

4) UDP as the first citizen transport.

MINA currently handles UDP like it's a TCP connection.  Consequently, we
had to provide some additional stuff like IoSessionRecycler and
IoAcceptor.newSession().  IMHO, session state management should be
completely optional when a user is using the UDP transport.  Possible
solution is to provide a different handler and session interface from TCP.

How do we execute all these changes? Well.. I think it's pretty easy to
do purely from technical point of view.  All the changes will make users
experience bigger backward incompatibility, but these issues should be
fixed somehow to make MINA a better netapp framework IMHO.

Any feed back is welcome.
-- 
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to