On Oct 23, 2006, at 11:07 PM, Niklas Therning wrote:
Do we need a setHandler() method in the interface at all? I would be fine with having to specify it in the constructor when creating my SocketAcceptor, SocketConnector, etc. In that case there shouldn't be any non-args constructor in these classes.

+1 to this.

anything that's immutable should be specified in the cxtor and made a final variable inside the instance. getters/setters should only be for runtime tweakable values.

Or we could just throw IllegalStateException once the service is in use (bind() called or connect(addr) called at least once) and make sure we document this. IMO, it would be a bad idea to let the user change the handler once the service is in use.

i *vastly* prefer passing in the cxtor. that way it is clearly visible from just looking at the API that it is an immutable value.

-pete


--
[EMAIL PROTECTED] - http://fotap.org/~osi



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to