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

eribeiro opened this Issue Aug 3, 2012 · 0 comments


None yet
1 participant

eribeiro commented Aug 3, 2012

I'd like to suggest the replacement of

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 join this conversation on GitHub. Already have an account? Sign in to comment