Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8593

Update native client examples to use Builder pattern

    XMLWordPrintableJSON

Details

    Description

      For both C++ and .NET examples, the section of code that creates the connection pool should be improved to better illustrate the Builder pattern. For example, in the C++ examples, current code is:

      ```

        auto cacheFactory = CacheFactory();

        cacheFactory.set("log-level", "none");

        auto cache = cacheFactory.create();

        auto poolFactory = cache.getPoolManager().createFactory();

       

        poolFactory.addLocator("localhost", 10334);

        auto pool = poolFactory.create("pool");

      ```

      The improved version would be:

      ```
      auto cache = CacheFactory()
      .set("log-level", "debug")
      .set("ssl-enabled", "true")
      .set("ssl-truststore", clientTruststore.string())
      .create();
      cache.getPoolManager()
      .createFactory()
      .addLocator("localhost", 10334)
      .create("pool");
      ```

      Similarly for .NET examples.

      These doc snippets also appear in the user guides, so they'll need updating in the docs, as well.

      Attachments

        Activity

          People

            dbarnes Dave Barnes
            dbarnes Dave Barnes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: