Summary
Resolve inconsistent visibility modifiers in the cds-feature-recommendations module and clarify what constitutes public API.
Problem
| Class |
Current Visibility |
Expected |
RptInferenceClient |
public |
Unclear |
FioriRecommendationHandler |
package-private |
Correct |
MockRecommendationClient |
package-private |
Correct |
RecommendationClient |
package-private |
Correct |
RecommendationClientResolver |
package-private |
Correct |
In cds-services, the convention is:
- Public:
CdsRuntimeConfiguration implementations and service interfaces
- Package-private: Everything else (handlers, clients, utilities)
RptInferenceClient is currently public, and it is used externally by the sample bookshop:
// samples/bookshop/.../AICoreShowcaseHandler.java:146
new RptInferenceClient(service.inferenceClient(rg, deploymentId), service.getRetry());
Decision Needed
Option A: RptInferenceClient is intentional public API
- Add Javadoc documenting it as a public utility for applications that need direct RPT access
- No visibility change
Option B: RptInferenceClient should be internal
- Make package-private
- Update sample to use
AICoreService API directly (without manually constructing inference clients)
- Consider adding a convenience method to
AICoreService or a public factory if the use case is legitimate
Recommendation
Option B aligns better with cds-services conventions. The sample should demonstrate the recommended way to use the library, not internal implementation shortcuts.
Files
RptInferenceClient.java (visibility change or Javadoc)
- Possibly:
samples/bookshop/.../AICoreShowcaseHandler.java (if updating sample usage)
Summary
Resolve inconsistent visibility modifiers in the
cds-feature-recommendationsmodule and clarify what constitutes public API.Problem
RptInferenceClientpublicFioriRecommendationHandlerMockRecommendationClientRecommendationClientRecommendationClientResolverIn
cds-services, the convention is:CdsRuntimeConfigurationimplementations and service interfacesRptInferenceClientis currentlypublic, and it is used externally by the sample bookshop:Decision Needed
Option A:
RptInferenceClientis intentional public APIOption B:
RptInferenceClientshould be internalAICoreServiceAPI directly (without manually constructing inference clients)AICoreServiceor a public factory if the use case is legitimateRecommendation
Option B aligns better with
cds-servicesconventions. The sample should demonstrate the recommended way to use the library, not internal implementation shortcuts.Files
RptInferenceClient.java(visibility change or Javadoc)samples/bookshop/.../AICoreShowcaseHandler.java(if updating sample usage)