On Fri, 17 Aug 2007 20:42:23 +0900
"Trustin Lee" <[EMAIL PROTECTED]> wrote:

> On 8/17/07, Julien Vermillard <[EMAIL PROTECTED]> wrote:
> > Hi,
> > It think the ProtocolDecoder implementer can encapsulate his logic
> > under some other class if it doesn't want to depend on MINA, but
> > with ByteBuffer, and all the point Maaarten added (like
> > ProtocolDecoderOutput) I think it won't be easly doable without
> > breaking the codec API and sacrifice some of it simplicity.
> 
> Yeah, you are right.  I forgot the ByteBuffer! :)
> 
> But the point here is to decouple a codec from IoSession so the codec
> can be easily adaptable into other application component.  ByteBuffer
> and ProtocolEncoder/DecoderOutput is very easy to convert as you know
> because they are very simple, but IoSession is a different beast.
> 
> We could provide a mock implementation of IoSession, but I guess it
> will not look nice (i.e. it violates OO principle).
> 
> Thanks,
> Trustin
A good use for a Codec outside of the ProtocolFilter could be (at least
for me) serializing to file a stream of object/messages.

HTH
Julien

Reply via email to