Yes, ZMTPSession is a bit quirky. As for configuration beans, I prefer them
over long method signatures, especially if some parameters have the same
type and/or are optional, although the builder pattern is perhaps better
still.

--
dano


On Sat, Dec 28, 2013 at 3:59 PM, Noa Resare <notifications@github.com>wrote:

> In src/main/java/com/spotify/netty/handler/codec/zmtp/CodecBase.java:
>
> > +import org.jboss.netty.handler.codec.replay.ReplayingDecoder;
> > +import org.jboss.netty.handler.codec.replay.VoidEnum;
> > +
> > +/**
> > + * An abstract base class for common functionality to the ZMTP codecs.
> > + */
> > +abstract class CodecBase extends ReplayingDecoder<VoidEnum>  {
> > +
> > +  private final ZMTPSession session;
> > +  private final boolean enveloped;
> > +  protected final byte[] localIdentity;
> > +  protected HandshakeListener listener;
> > +
> > +  CodecBase(byte[] localIdentity) {
> > +    this.localIdentity = localIdentity;
> > +    boolean enveloped = localIdentity != null;
>
> Please have a look at 2d3c4ba<https://github.com/spotify/netty-zmtp/commit/2d3c4ba556ebb176c9110ad6a45402be8ba7f413>I have introduced a socketType property to ZMTPSession and moved some stuff
> around.
>
> Personally I think many parameters are better than config beans, but
> that's just a preference (And I also think that ZMTPSession is a bit
> problematic as it is both a config bean and a communications channel to
> extract remoteIdentity) but I that's a question for a later time.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/spotify/netty-zmtp/pull/7/files#r8576424>
> .
>