Package structure: org.http4s.$role.$backend or org.http4s.$backend.$role
See original GitHub issueThis discussion originated in the ember PR, but we didn’t have a strong consensus. Ember is org.http4s.ember.client
. Blaze (and all other backends) are org.http4s.client.blaze
. There are good reasons for both, but I think consistency is better than either argument. Let’s standardize on one.
Quoting a fool:
One thing that we all got right is to have both $backend and (server | client) in the package name. The Jetty server is older than the Jetty client, but we were able to add the client without moving the server later. So it’s really a matter of which comes first. I’d like us to be consistent. I’m willing to consider deprecating and moving the other backends with a scalafix.
- There’s more package-private code in ember than there is in server and client, so ember benefits from this convention. The alternative is to leave ember-core in org.http4s.ember, but make everything private[http4s].
- There’s also quite a bit in blaze, which could benefit from backend-first. But org.http4s.blaze is the blaze project’s package, so we need to be very careful about polluting that namespace. We’ve solved that today with a blazecore for the shared code, all private[http4s]. We could maybe move non-http4s blaze out of org.http4s, but to where? That’s a lot of moving for something nobody has complained about.
- There’s no shared http4s-jetty code between server and client. If there were, the ember convention would be a little nicer.
- No other backend has both a server and client. These can all benefit slightly from the current convention, with package-private server and client helpers. But the one and only that exists right now is DefaultClient.
Points 3 and 4 are weak. 1 is a good argument for change. 2 is a good argument for the status quo.
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (22 by maintainers)
Top GitHub Comments
I have some naming suggestions:
@amesgen
org.http4s.jdkhttpclient
ororg.http4s.jdk.client
@vasilmkdorg.http4s.asynchttpclient
ororg.http4s.ahc.client
Feel free to work on it @krayoola 😄