mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: [MINA3] Some points
Date Mon, 08 Apr 2013 16:04:53 GMT
Le 4/8/13 5:46 PM, Jeff MAURY a écrit :
> Hello,
> as I has been working on the Codec API and MINA3, I have some points I want
> to share with you:
> 1) Codec API
> The new Codec API does not define exceptions. It seems that the old one
> does with the notion of recoverable exception, should we define exceptions
> as well or no. If no, then we should document how an exception should be
> generated (RuntimeException, any other) and which are the preferred ones.
We already discussed aout the exceptions, and how they should be
handled, and up to a point, we decided to not create an exceptionCaught
event - like what we have in Mina2 -, but this was not a final decision.

All in all, this is an aspect which is not well covered yet.

> Also, the decoder is expected to return an array of object, wouldn't it
> better to return a Collection ?
Depends. I don't even know if it's a good idea at all to return a list
or an array of decoded objects. What about sending each decoded message
as soon as we have one, keeping the current state for further calls ?
The idea would be to have a non-blocking decoder we can use this way :

while ( ( message = decode( data ) ) != null ) {
  do somethng with the decoded message


> 2) Session objects are not immutable
> I noticed that session objects (assigned to clients and servers) are not
> immutable, but I think changing properties of such objects may lead to
> unexpected behavior. Would the Builder pattern more accurate ?

Not sure. The session might change, as we store attributes into it.Jeff

Emmanuel Lécharny

View raw message