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

Too many (and confusing) import options in code-first sdk #1862

Open
octonato opened this issue Nov 16, 2023 · 2 comments
Open

Too many (and confusing) import options in code-first sdk #1862

octonato opened this issue Nov 16, 2023 · 2 comments
Labels
DX Developer Experience related issue

Comments

@octonato
Copy link
Member

When building an application with the code-first SDK, a user have too many classes with the same name to import.

If, for example you want to implement an EventSourcedEntity, you get the following list of imports to choose from:

event-sourced-entity

From all this options, only kalix.javasdk.eventsourcedentity.EventSourcedEntity is correct.

The one in kalix.javasdk.annotations.Subscribe is a public one. It's used to subscribe to events produced by an event-sourced entity.
Here we could eventually deprecate it and introduce something else, for example:

@Subscribe.EventsFrom(ShoppingCartEntity.class) where ShoppingCartEntity is a ES.

The classes in kalix.component, kalix, kalix.protocol, kalix.annotations.CodegenOptions, kalix.eventing could be hidden from the user using java modules. They are internal Kalix classes and should not be exposed, confuse or distract the users.

The same happens for the other types we have.

Value Entity

value-entity

Same as above, the annotation could be refactored to:

@Subscribe.StateFrom(ShoppingCartEntity.class) where ShoppingCartEntity is a VE.

Action

action

View

view

Workflow

workflow

@octonato octonato added the DX Developer Experience related issue label Nov 16, 2023
@aludwiko
Copy link
Contributor

Oh yes, it's frustrating even for me :)

@octonato
Copy link
Member Author

I didn't know that, but scalac doesn't support JPMS, meaning that we are out of options for now.

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

No branches or pull requests

2 participants