You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the general plan for the client? Elsewhere I was suggesting to remove it, but only because it's duplicated in another project.
In general, it can of course be a good idea to have the (same-language) client in the same repository, precisely because serialization code and representations can be shared. Dropwizard recommends it. It should go into a different JAR, of course, so rather than being in "web", it should be in a "client" module. Client code can then include the client JAR and that's it..
So maybe we move the "hand-coded" client over here? In general?
Yes, this might be a good solution to move the hand-coded into a new client maven module. The only problem is that we would either have to split the hand-coded matrix part and keep it externally or put it here, which would mix the open source with the API which I would like to avoid to reduce confusion.
which would mix the open source with the API which I would like to avoid to reduce confusion.
Hmmh, this is kind of 'violated' already as the GraphHopperWeb points to the commercial offering per default. So moving the hc client into this repo sounds good to me and we can finally avoid duplicate code.
Related: What is the plan for the Swagger spec? Is it just a side-project, or do we want to make it more authoritative by reviewing it, adding documentation and perhaps eventually generating the official API docs from it?
I thought the approach would be the other way around? Move the GraphHopperWeb file into the hc part and use this as a test dependency? The GraphHopperWeb is only used for testing purposes.
The problem then will be that we have a circular dependency of the repositories: test web module (GH repo) -> hc client (other repo) -> core (GH repo) which might be too complex (?)
Dependencies aside, the argument for having client and server in the same repository is that they can (easily) share the same representation objects and serialization/deserialization code, and that the developer of the server will also develop the client, looking at the whole use case.
What are the arguments for having it in a separate repository?
"A user may only want the client" -- okay, but they will usually use a Maven dependency, not check out the source code.
Note: I also really like the Swagger stuff and auto-generated clients, but I think those are a different story, and would perhaps be better off if they were in their repository alone, without the "hand-coded" stuff. That whole repository could basically be auto-generated by Swagger.
What are the arguments for having it in a separate repository?
Well it depends, if we put the client into it's own package, I don't see a good reason against this, besides some users might be a bit confused that suddenly the location of the client changed. If we leave the client (GraphHopperWeb) in the web client the downside is that anybody using the client would end up with all the dependencies of the web module.
I also really like the Swagger stuff and auto-generated clients, but I think those are a different story, and would perhaps be better off if they were in their repository alone, without the "hand-coded" stuff. That whole repository could basically be auto-generated by Swagger.
Yes, I am fine with that. We should also note that right now the hc client cannot solve all functions of the API (e.g. geocoding).
Activity
michaz commentedon Aug 22, 2017
What is the general plan for the client? Elsewhere I was suggesting to remove it, but only because it's duplicated in another project.
In general, it can of course be a good idea to have the (same-language) client in the same repository, precisely because serialization code and representations can be shared. Dropwizard recommends it. It should go into a different JAR, of course, so rather than being in "web", it should be in a "client" module. Client code can then include the client JAR and that's it..
So maybe we move the "hand-coded" client over here? In general?
karussell commentedon Aug 22, 2017
Yes, this might be a good solution to move the hand-coded into a new
clientmaven module. The only problem is that we would either have to split the hand-coded matrix part and keep it externally or put it here, which would mix the open source with the API which I would like to avoid to reduce confusion.karussell commentedon Aug 22, 2017
Hmmh, this is kind of 'violated' already as the GraphHopperWeb points to the commercial offering per default. So moving the hc client into this repo sounds good to me and we can finally avoid duplicate code.
michaz commentedon Aug 22, 2017
Related: What is the plan for the Swagger spec? Is it just a side-project, or do we want to make it more authoritative by reviewing it, adding documentation and perhaps eventually generating the official API docs from it?
karussell commentedon Aug 22, 2017
Definitely not. Why do you think so?
The swagger spec and clients generated are already working. Also there is a bit documentation for this already inside the spec. But a few bigger issues remain (limitation of either the codegen or swagger spec itself) like https://github.com/graphhopper/directions-api-clients/issues/1
michaz commentedon Aug 22, 2017
Just asking. For example, it does not generate the official API documentation, but duplicates it.
michaz commentedon Aug 22, 2017
I could do that on the Dropwizard-PR. Would fit nicely there because of close connections to "doing more with Jackson" and "sharing representations".
karussell commentedon Aug 22, 2017
I'm more for smaller PRs :) maybe a second PR based on the Dropwizard branch?
michaz commentedon Aug 22, 2017
Okay, sure.
boldtrn commentedon Aug 24, 2017
I thought the approach would be the other way around? Move the GraphHopperWeb file into the hc part and use this as a test dependency? The GraphHopperWeb is only used for testing purposes.
karussell commentedon Aug 24, 2017
The problem then will be that we have a circular dependency of the repositories: test web module (GH repo) -> hc client (other repo) -> core (GH repo) which might be too complex (?)
michaz commentedon Aug 24, 2017
Dependencies aside, the argument for having client and server in the same repository is that they can (easily) share the same representation objects and serialization/deserialization code, and that the developer of the server will also develop the client, looking at the whole use case.
What are the arguments for having it in a separate repository?
"A user may only want the client" -- okay, but they will usually use a Maven dependency, not check out the source code.
michaz commentedon Aug 24, 2017
Note: I also really like the Swagger stuff and auto-generated clients, but I think those are a different story, and would perhaps be better off if they were in their repository alone, without the "hand-coded" stuff. That whole repository could basically be auto-generated by Swagger.
boldtrn commentedon Aug 25, 2017
Well it depends, if we put the client into it's own package, I don't see a good reason against this, besides some users might be a bit confused that suddenly the location of the client changed. If we leave the client (GraphHopperWeb) in the web client the downside is that anybody using the client would end up with all the dependencies of the web module.
Yes, I am fine with that. We should also note that right now the hc client cannot solve all functions of the API (e.g. geocoding).
devemux86 commentedon Aug 25, 2017
Agreed that wouldn't be nice.
michaz commentedon Aug 25, 2017
Yeah, it would go in its own module, of course.