On 10/17/06, peter royal <[EMAIL PROTECTED]> wrote:
the one thing that I like about the current API that this "looses" is
that the current API allows the Connector's to be like a "factory",
since the config/filters can be pre-set on the Connector and clients
that use the Connector just have to provide an IoHandler / target
address.
of course, the way to solve this is to just make a *ConnectorFactory
that wraps this new API. the added bonus is that things like the
Handler can be set on the factory as well, so that client code just
needs to provide a target IP.
Sounds like a good idea.
i'd also like to use some interfaces to separate concerns too...
class DefaultSocketConector implements ConfigurableSocketConnector
{
// impls of everything
}
interface ConfigurableSocketConnector extends SocketConnector {
// all of the setters and getters to config, things that pure-
consumers of a connection don't need to fiddle with
}
This makes sense. Very good for separation of concerns. I think we can
apply this separation as the next step of the refactoring.
interface SocketConnector {
// the bare-minimum of methods that consumers of a connection need
to deal with to connect
void setRemoteAddr()
void setLocalAddr()
void connect();
void close();
}
Isn't it getRemoteAddr() and getLocalAddr()? Am I missing something?
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6