Only expose APIs that are truly necessary for external consumers and avoid creating public interfaces that may become maintenance burdens. Before adding public builders, helper utilities, or exposing internal types, critically evaluate whether they provide genuine value to API users.
Only expose APIs that are truly necessary for external consumers and avoid creating public interfaces that may become maintenance burdens. Before adding public builders, helper utilities, or exposing internal types, critically evaluate whether they provide genuine value to API users.
Key principles:
Example from the codebase:
// Instead of exposing a public Builder that may not be used:
public interface MergeMetrics {
class Builder { /* public builder methods */ }
}
// Consider internal implementation:
// Keep MergeMetrics as interface, add internal case class like LogicalWriteInfo
// or make it a proper Java class with utility construction method
This approach reduces long-term API maintenance overhead while keeping the public interface clean and focused on genuine user needs.
Enter the URL of a public GitHub repository