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

Remove all setters from the "operation" package operation types

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: CRUD
    • Labels:

      All operation structs in the x/mongo/driver/operation package currently use the "chainable setter" pattern to configure operations. However, those APIs are not currently intended for use outside of the Go driver and none of those setters contain any additional logic (i.e. just set the passed-in value). As a result, the setters do not deliver additional value and are just additional code to maintain. Remove all setter functions from the x/mongo/driver/operation operation structs and export all operation struct fields.

      Definition of done:

      • Remove all "chainable setter" functions from the x/mongo/driver/operation operation structs.
      • Export all fields in the x/mongo/driver/operation operation structs.
      • (Optional) Consider removing the Result field from all operation structs and make it a return value or output argument from the [operationType].Execute function. Note that this may require using Go generics, so may only be possible in Go Driver 2.x.
      • (Optional) Consider removing all fields from operation structs except those that are required to implement the operation type's Execute function. All other fields would be set directly on a driver.Operation in the CRUD API.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: