Move Static factory methods off the class they construct.
Open
gRPC 2.0
usability
- Dominant language
- Java
- Stars
- 12.1k
- Forks
- 4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Description
The `ManagedChannelBuilder` and `ServerBuilder` classes both expose static factory methods as a means to construct instances of themselves. These classes can be extended, which means that all subclasses inherit the static methods.
However, when these static methods are call on the subclasses, they often return a different type than expected (InProcessChannelBuilder returns based on the service loader, for instance. See #3438). This leads to confusion, and forces every subclass to add static methods that match the signatures)
Contributor guide
Assessment
This issue has not been assessed yet.