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

add Finder interface #436

Closed
wants to merge 1 commit into from
Closed

add Finder interface #436

wants to merge 1 commit into from

Conversation

gavinking
Copy link
Contributor

Draft proposal for a new Finder interface allowing typesafe passing of caching and locking options and an EntityGraph.

see #383

@trajano
Copy link

trajano commented Aug 9, 2023

What happens when both loadGraph and fetchGraph are provided?
If we only allow one then

with(EntityGraph eg, EntityGraphLoadType loadOrFetch)

@gavinking
Copy link
Contributor Author

gavinking commented Aug 9, 2023

What happens when both loadGraph and fetchGraph are provided?

Well, what happens today if you specify both hints? The semantics should be the same, I guess.

@gavinking
Copy link
Contributor Author

[P.S. Please compare this to #415 which has slightly different naming conventions.]

@trajano
Copy link

trajano commented Aug 9, 2023

What happens when both loadGraph and fetchGraph are provided?

Well, what happens today if you specify both hints? The semantics should be the same, I guess.

Correct, that semantic should be defined or be made explicit. It does not make sense to have both of them and the behaviour is presently undefined.

I'd like to change the proposal though to reverse the parameter order

with(EntityGraphLoadType loadOrFetch, EntityGraph eg)

So when people code it

.with(FETCH, myEntityGraph)
.with(LOAD, myEntityGraph);

And explicitly state to prevent ambiguity that the later of the two with will win.

@gavinking
Copy link
Contributor Author

So that makes perfect sense, but personally I find it really quite a lot less ergonomic. IDEs do a somewhat better job of completing enum values than in the past, but even so I really find that they still get in the way and disrupt my "flow" when I'm typing this kind of code.

@gavinking gavinking closed this Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants