websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-116

WebSocketContainer.connectToServer ease of use / API change

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      (from Scott)

      The new connectToServer is difficult to use.

      Instead of a Class parameter, it should be an object. The container shouldn't need to instantiate the object, and the Class model makes it difficult to connect between the client application and the client endpoint. (Because any shared state/object needs to be passed through a custom ClientEndpointConfiguration.)

      The API should be simplified to:

      WebSocketContainer {
      Session connectToServer(Object endpoint, URI path);

      Session connectToServer(Object endpoint, URI path, ClientEndpointConfiguration cec);
      }

      If the "endpoint" object is already of type Endpoint, it's used directly. Otherwise, a skeleton/proxy is created, i.e. annotation stuff.

      There's no need for separate methods for Endpoint vs annotation.

        Issue Links

          Activity

          Hide
          dannycoward added a comment -

          awaiting last feedback on whether to add these methods

          Show
          dannycoward added a comment - awaiting last feedback on whether to add these methods
          Hide
          dannycoward added a comment -

          This has been added in v014, with the disclaimers that dependency injection may not work.

          Show
          dannycoward added a comment - This has been added in v014, with the disclaimers that dependency injection may not work.

            People

            • Assignee:
              dannycoward
              Reporter:
              dannycoward
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: