Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Replace ZookeeperClient's get() method by .getOrCreate() #57

Open
eribeiro opened this issue Aug 3, 2012 · 0 comments
Open

Replace ZookeeperClient's get() method by .getOrCreate() #57

eribeiro opened this issue Aug 3, 2012 · 0 comments

Comments

@eribeiro
Copy link

eribeiro commented Aug 3, 2012

I'd like to suggest the replacement of

http://twitter.github.com/commons/apidocs/com/twitter/common/zookeeper/ZooKeeperClient.html#get()

by getOrCreate() because the latter provides a more descriptive name of the method contract. On the other hand, we should avoid to break any client code so I'd propose the following steps:

  1. Mark get() methods as @deprecated, followed by "Use getOrCreate method instead."
  2. Insert the respective getOrCreate() methods and move the logic from get() to getOrCreate().
  3. Make get() just delegate to its respective getOrCreate() method.
  4. Update the tests and javadoc so that it can now reflect this change.

After those changes, the method get() can be removed in the future without leaving broken client code on the way AND we the class may have a method that better describes its result (the first time I read it, I didn't assume it would create a ZK connection, only after reading the javadoc and source code I saw this).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant