Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3058

Centralize x-package Connection interface as a struct

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Context

      The driver.Connection interface is returned by various functions with the x package, which is a pattern in conflict with the Go idiom of "accept interfaces, return structs" defined in the wiki: https://github.com/golang/go/wiki/CodeReviewComments#interfaces . And generally violates the robustness principle: https://en.m.wikipedia.org/wiki/Robustness_principle

      Furthermore, this pattern makes migrating the description package to the internal package difficult since the connection interface has a dependency on the description package. 

      Definition of done

      We should centralize the connection object as a struct in a one-off package in the x/mongo/driver director. This was we can take an experimental subset of the server object as the description.

      Pitfalls

      Unknown

            Assignee:
            preston.vasquez@mongodb.com Preston Vasquez
            Reporter:
            preston.vasquez@mongodb.com Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: