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

Find better solution for Views and Actions name clashes #238

Closed
octonato opened this issue Aug 25, 2021 · 3 comments
Closed

Find better solution for Views and Actions name clashes #238

octonato opened this issue Aug 25, 2021 · 3 comments
Assignees
Labels
java-sdk-protobuf kalix-runtime Runtime and SDKs sub-team

Comments

@octonato
Copy link
Member

Triggered by #237 (comment)

Views and Actions are generated from the gRPC service define in the proto file and that clashes with the service generated by akka-grpc.

That can be surprising for users. They define a service like HelloService, but get a HelloServiceAction instead. Or they call it HelloAction, but get a HelloActionImpl.

And they end up with HelloAction.java (generated by akka-grpc) and HelloActionImpl.java (generated by the akkasls codegen). And those are not related to each other at code level.

Entities doesn't suffer from that issue because the generated code follows the domain name, not the gRPC service.

@octonato
Copy link
Member Author

Relates to #207

Maybe not worth to find a solution for this. Appending View and Action may be the easiest solution we have. The Impl looks weird for abstract/interface though.

Pity that views and actions will look different then Entities.

Anyway, I'm leaving this open for now to let it sink a bit more.

@johanandren
Copy link
Contributor

One annoying scenario when appending View is when the name already contains the name view - in the eventing-shopping-cart ShoppingCartViewService leads to the class ShoppingCartViewServiceView.

@patriknw
Copy link
Contributor

To continue the "hack" we can add Impl instead of View when the original name contains "View" instead of ends with "View".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java-sdk-protobuf kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

No branches or pull requests

3 participants