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

chore: aligning view store sample #118

Open
wants to merge 3 commits into
base: java-spi
Choose a base branch
from

Conversation

aludwiko
Copy link
Contributor

  • package structure
  • Endpoints instead of direct component calls
  • removing remaining direct component calls docs

@github-actions github-actions bot added the documentation documentation related label Dec 27, 2024
@@ -1,19 +1,19 @@
package store.view.joined;
package store.order.view.joined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to keep a separate "view" package, because that's what we want to highlight in this sample.

Copy link
Contributor

@pvlugter pvlugter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 46 to 65
@Get("/joined-by-customer/{customerId}")
public CompletionStage<JoinedCustomerOrdersView.CustomerOrders> joinedByCustomer(String customerId) {
return componentClient.forView()
.method(JoinedCustomerOrdersView::get)
.invokeAsync(customerId);
}

@Get("/nested-by-customer/{customerId}")
public CompletionStage<CustomerOrders> nestedByCustomer(String customerId) {
return componentClient.forView()
.method(NestedCustomerOrdersView::get)
.invokeAsync(customerId);
}

@Get("/structured-by-customer/{customerId}")
public CompletionStage<store.order.view.structured.CustomerOrders> structuredByCustomer(String customerId) {
return componentClient.forView()
.method(StructuredCustomerOrdersView::get)
.invokeAsync(customerId);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only part that doesn't read so well to me, with importing the different CustomerOrders in different ways — directly, nested class, full package. Could be be better to prefix each of those classes instead:

public CompletionStage<JoinedCustomerOrders> joinedByCustomer(String customerId)

public CompletionStage<NestedCustomerOrders> nestedByCustomer(String customerId)

public CompletionStage<StructuredCustomerOrders> structuredByCustomer(String customerId)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixed

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

Successfully merging this pull request may close these issues.

2 participants