Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-1004

Refactor ClusterManager class so that it is DRY

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • backlog-2.0
    • 2.1.4, 2.2.0
    • library
    • None

    Description

      This class has duplicate code in multiple and can/should be refactored so that common paths are not duplicated. Simon said:

      "yeah I was under the impression methods like renameNodesAsync, InitializeClusterAsync, etc... share a lot of common 'establishing the http client' code that could be in its own method, passing in the actual payload or a lambda containing the actual differing work"

      • There are various other design problems and it lacks symmetry with respect to async/sync methods as well.
      • The unit tests have a dependency on an actual cluster being provisioned; it would be nice if we could mock/fake these dependencies (if possible)
      • Improved documentation in places where it's missing
      • If appropriate utility methods can be possibly refactored into utils and extension classes.

      What can't change:

      • No breaking changes with existing IClusterManager - i.e. parameter changes, naming etc. (private methods and new methods are acceptable).
      • Behavior should not change (unless it is incorrect, then it should be fixed).

      **See ViewClient and QueryClient; are their opportunities for reuse/refactoring?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jmorris Jeff Morris
            jmorris Jeff Morris
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty