-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve modularity around client/server split #135
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented But isn't it ok for javax.websocket-api.jar to have a dependency on javax.websocket-client-api.jar ? Where are you facing the problem with two jars ? |
@glassfishrobot Commented
It's confusing if nothing else but it could potentially lead to issues in the future when there is more than one version of the websocket api. |
@glassfishrobot Commented one that runs on web servers The client/server terminology is explained in the spec document, but a websocket client is one that only initiates connections, a websocket server is one that accepts connections. The first profile needs to do both (the expert group wants websockets on a web server to be able to accept connections and initiate them). The second profile only needs to have 'client' functionality (the expert group wanted the desktop profile to initiate connections but not accept them). If only the web server didn't have 'client' functionality it would all be easier ! The javax.websocket package is everything in common to both profiles. The javax.websocket.server package is everything that only applies to websockets in web servers. So we have the right split of packages/classes for the two profiles. We will always version them the same, and release updates simultaneously. Would it help to call the JAR files something different ? javax.websocket-web and javax.websocket-client ? Danny |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
As of draft 12 there are two jars named "javax.websocket-api" (aka server) and "javax.websocket-client-api". As in draft 11 there is a server sub-package with all other classes (common and client) being in the top level package. I understand most implementations are expected to implement client and server API, while it's also possible for a library to implement client side only. However, things look pretty confusing to someone not familiar with that implicit expectation.
Given "javax.websocket-client-api", one would expect "javax.websocket-server-api" with shared functionality in "-common" or "-core". This does mean one extra module but that makes more sense from an application perspective at runtime. If I'm writing a server-only application I need to depend on server and common whereas currently I'd have to depend on server and client with client being included only because I need the common (and not the client) classes.
Similarly it would greatly help in understanding the API if there was a client package just like there is a server package. It's very easy to recognize the 6 server-specific classes but the top level package contains 25 classes and it's not easy to make out which ones are shared and which ones are client specific. To look at it from another perspective, if there is a server package why shouldn't there be a client package?
The text was updated successfully, but these errors were encountered: