On Mon, 16 Jun 2008 22:54:58 +0200 Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:
> Hi gang, > > I have recently reviewed some part of the IoSession inheritence tree, > and discovered that some interfaces are just useless : > - SocketSession > - DatagramSession > > I suggest we remove them (it won't harm the project or the tests in > any case). > > Anyone see a reason to keep those useless and undocumented > interfaces ? > > Thanks ! > Hi, As far I understand it, they are there for having the good type returned when you call getLocalAddress and getRemoteAddress. Cause most of time we use IoSession typed sessions, I don't think it's very useful, you need to cast the IoSession into the correct type for having the good getXXAddress return type. ex : IoSession session = connectFuture.getSession(); InetSocketAddress address = ((InetSocketSession)session).getLocalAddress(); So we can cast the result of getXXXAddress directly and remove those interfaces. IoSession session = connectFuture.getSession(); InetSocketAddress address = (InetSocketAddress)session.getLocalAddress(); For DatagramService and SocketService look like it's the case too. I think the hierarchy tree look like a bit over-engineered, but it's perhaps my taste for simple things ;) Julien
signature.asc
Description: PGP signature
