Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-4895

.NET SDK Example code leads to bad programming practices

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • csharp, sdk
    • .NET

    Description

      The example code under "Storing and Getting a document" uses a "using" pattern where the Bucket object is created and used for the scope of getting a single document. This leads users learning the SDK the impression that this is the pattern they should use, and thus creating and disposing of Bucket objects for every Couchbase interaction. Best Practices state that the Bucket object should be used as a singleton object, being opened once and then used for all Couchbase interactions until the application is shutdown. This example code should be modified to use the existing bucket object created in the prior example on the page.

      Attachments

        Activity

          People

            richard.smedley Richard Smedley
            davis.chapman Davis Chapman [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty