-
Notifications
You must be signed in to change notification settings - Fork 38
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
View Effects implementation #240
Conversation
0058d65
to
344de22
Compare
I merged #230 so this can be rebased now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good
I thought you said that you had codegen for this also, not pushed yet, or I misunderstood?
samples/java-eventing-shopping-cart/src/main/java/shopping/cart/AbstractShoppingCartView.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/akkaserverless/javasdk/AkkaServerless.java
Outdated
Show resolved
Hide resolved
sdk/src/main/scala/com/akkaserverless/javasdk/impl/view/ViewHandler.scala
Outdated
Show resolved
Hide resolved
sdk/src/main/scala/com/akkaserverless/javasdk/impl/view/ViewsImpl.scala
Outdated
Show resolved
Hide resolved
tck/src/main/java/com/akkaserverless/javasdk/tck/model/view/ViewTckModelBehaviorHandler.java
Outdated
Show resolved
Hide resolved
Started on codegen but nothing pushable or at least reviewable yet, and got stuck with other things today so haven't made any progress there. |
2bd66a8
to
4fc1da4
Compare
4fc1da4
to
b5cae6a
Compare
One thing left now, I think: how to deal with views without transform updates. I'm thinking if we should generate a separate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good
.../java-gen/src/main/scala/com/lightbend/akkasls/codegen/java/ViewServiceSourceGenerator.scala
Outdated
Show resolved
Hide resolved
I like this alternative. Would be good also for the upcoming transform_results combination. |
val classNameQualified = s"${fqn.parent.javaPackage}.$viewClassName" | ||
val providerNameQualified = s"${fqn.parent.javaPackage}.$providerName" | ||
|
||
val state = State(commands.head.outputType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just picking the first command output type as the state type is not quite safe, one scenario where it will break that I can think of is a view with no transform and only a query that "projects" the result into some other type (unless I remember wrong that we support that).
I don't have a great idea for a more foolproof way to figure out the state type though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a validation for the return types, if that is the case you think about: AS-00109 All View update methods must have the same return type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe I'm misinterpreting that the commands
here will include both queries and update method - was thinking that the first command (not sure how they are ordered) could be the query, and that could be a projection into some non-state type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I understand, you are right if commands includes both update methods and query methods. it should look for a update method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did something about that now, looking only at the first update method (with some test coverage). Not sure if there may still be cases I have not thought about.
I found one issue that is messed up but that I don't think surfaces with the current enabled samples compiled/tested and that is the de-duplication of names where it tries to add Right now that turns |
related to the View/Impl naming is #238 |
sdk/src/main/scala/com/akkaserverless/javasdk/impl/view/ViewHandler.scala
Outdated
Show resolved
Hide resolved
Ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
On top of #230
Refs #52
Dropped annotations, handcoded
Provider
andHandler
s in one sample and the TCK (which passes)