-
Notifications
You must be signed in to change notification settings - Fork 93
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 a common shared contract for the sessions #2104
Comments
@FroMage do you really need this. I'm not very keen on it. |
I'm not sure about the extra |
I don't really need it, I've abstracted around it using inheritance and subclasses to deal with the two session types, but they're calling the same damn methods with the same name and signature. And ORM has Looks to me like this is an improvement worth having, and is in line with the ORM sessions types. Not absolutely necessary, but definitely easier to deal with mixed session types, for 5-6 methods. |
The reason I'm hesitant is that these things are inner types and it's already a PITA to navigate around inside the I mean, it's not a strong objection. Also:
Perhaps it's an analog of |
Yeah, I suppose this one has different names, we can leave it out. |
I'll need a few more operations, hold on. |
Well, not just different names; different semantics. |
potato, tomato 😅 |
"get me this thing by id" |
"Get me a managed object" and "get me a detached object" are pretty different. |
I've heard you say that, and yet the query operations are the same to get one or the other type :) |
Two more methods needed: Filter enableFilter(String filterName);
void disableFilter(String filterName); |
Haha you got me there :) |
I know, and that's going to be hard to defend 🤣
Assuming I know how managed sessions work (and with ORM, I need to understand the difference between managed/auto-update and manual state tracking) then the fact that the entity is removed from the tracking list is just one of many side-effects that deleting an entity has. There's more side-effects, but those are not explicitly called out by the method name. Why this one is singled out, I'm not sure. I suppose it's historical. But still I feel the difference between Perhaps that's just me, though. |
Just give me my shared session interface or I will keep arguing into renaming more things 🤣 |
Well you have to look at the bigger picture. The whole model if explicit CRUD is very different to to the model with stateful sessions, and we've seen lots of problems over the years when we let users muddle those two things up in their heads.
But that's not even the most important difference. The most important differences are:
OK, now do |
What I'm saying is you're making a mistake by focussing on one method. These methods combine to form a whole protocol:
And these protocols are really different in nature. Now, sure, it's true that they used to be more different before, when we didn't have second-level caching and collections in stateless sessions, and it's true that we reuse the query APIs between the two flavors of session (only because we don't want to copy/paste the whole damn thing), but it's very important to keep a clear distinction between them. |
Is this your only issue with the name? Because, it doesn't sound too terrible to me, and it's the same name used in ORM (and I think it helps to have similar names between the two). For queries there is |
|
I've no idea what "Shared" means here. Shared between who? Certainly not between clients. Between its subtypes?? Ugh. And "Contract" is extremely redundant since every public type is a contract. If you didn't already know what a Now, in my proposal for JPA4, the analogous thing is called But if you absolutely have to do this right now, |
We can wait I guess |
I guess we should ask @FroMage if he is in a hurry. |
No hurry, I'm using a complicated setup of class inheritance to work around that. |
See quarkusio/quarkus#46091 (comment)
The text was updated successfully, but these errors were encountered: