[
https://issues.apache.org/jira/browse/ZOOKEEPER-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935075#action_12935075
]
Thomas Koch commented on ZOOKEEPER-836:
---------------------------------------
Well, here we enter matters of taste. Is it better, to have many classes with
each class having only a very limited responsability, like the unix philosopy
"do one thing and do it well"[1]? Or is it better to have few classes which
include everything they need?
It's my personal taste, that it makes perfect sense to have one class to parse
a connectString in a HostSet and a chrootPath and probably have a separate
HostSet class for itself. I can't force this taste on you, but it's one of my
strongest believes on how to write manageable code. - Small, independent,
testable, comprehensible units of code.
I don't understand your second paragraph. What do you mean with "resolved
addresses"? What are then "unresolved addresses"? Do you mean, we should manage
the HostSet as pairs of a hostNameString and a portNumber and only resolve it
(instantiate an InetSocketAddress and let it query DNS) as late as possible and
resolve it again on every connect attempt? - This could make sense and I'd ask
you to open a separate issue for it, please. I could then provide a patch for
it on top of this patch.
[1] http://en.wikipedia.org/wiki/Unix_philosophy
> hostlist as string
> ------------------
>
> Key: ZOOKEEPER-836
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-836
> Project: Zookeeper
> Issue Type: Sub-task
> Components: java client
> Affects Versions: 3.3.1
> Reporter: Patrick Datko
> Assignee: Thomas Koch
> Attachments: ZOOKEEPER-836.patch
>
>
> The hostlist is parsed in the ctor of ClientCnxn. This violates the rule of
> not doing (too much) work in a ctor. Instead the ClientCnxn should receive an
> object of class "HostSet". HostSet could then be instantiated e.g. with a
> comma separated string.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.