Skip to content
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

Context in its own package? #2847

Open
zhangkun83 opened this issue Mar 22, 2017 · 6 comments
Open

Context in its own package? #2847

zhangkun83 opened this issue Mar 22, 2017 · 6 comments
Milestone

Comments

@zhangkun83
Copy link
Contributor

Although io.grpc.Context is shipped in its own artifact, and non-gRPC users can also depend on it, the package name still causes branding issue (census-instrumentation/opencensus-java/issues/162), and a practical issue with OSGI (#2727). We may consider moving it into its own package and splitting it completely from gRPC.

We have two questions to answer:

  1. What should the new package name be? Probably something starting with com.google, but probably not com.google.common.context because it collides with a Google's proprietary context class.
  2. How to bridge the old Context and Deadline to the new ones.
@zhangkun83
Copy link
Contributor Author

cc @ejona86 @adriancole @bogdandrutu

@bogdandrutu
Copy link
Contributor

We can put it under com.google.instrumentation.context (but again it may not be generic enough and probably the name is too long). Can we put it in com.google.context or com.google.base?

@codefromthecrypt
Copy link
Contributor

codefromthecrypt commented Mar 30, 2017 via email

@zhangkun83
Copy link
Contributor Author

@bogdandrutu I don't see why instrumentation should be included in the package name. com.google.context sounds like a good choice.

@adriancole IMO non-organization-specific package names, especially with a widely used term like "context", go against the principles of Java package as a name-spacing measure. We are not the only context solution for Java, neither are we the canonical one (at least for now). We should be a good citizen and label our context with something can identify where it's from. Short fully-qualified class names in adapters is a non-goal, because adapters are one-off efforts.

@codefromthecrypt
Copy link
Contributor

@zhangkun83 your opinion duly noted :) just bear in mind that google branding this is a double-edged sword, especially since indeed the purpose of this library is for more than just google to use.

@aseovic
Copy link

aseovic commented Oct 3, 2017

As I mentioned in #3522, it definitely feels like something like this should already be a part of JDK, but unfortunately it isn't. Based on the discussion above, com.google.context does seem to make most sense.

The bottom line is that it certainly doesn't feel like it belongs to io.grpc namespace (or project), considering that it has nothing to do with gRPC itself, and that both instrumentation-api and opencensus-api depend on it (which creates a really strange dependency graph, considering that grpc-core depends on both of those).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants