Re: Proposal: Use of Realm Instead of RealmId

2025-01-31 Thread Yufei Gu
Hi Alex, I was saying that people might *NOT immediately* connect a realmId with a realm. They will figure it out in various ways for sure, like checking code/doc, but that's an inconsistency and unnecessary cognitive burden we can easily avoid. Yufei On Thu, Jan 30, 2025 at 7:20 AM Alex Dutra

Re: Proposal: Use of Realm Instead of RealmId

2025-01-30 Thread Alex Dutra
Hi, I must say, I am more and more confused by this discussion. This came as a surprise to me: people may keep thinking "realm" and "realmId" are different things Well, for me they are different things. As I said before, the notion behind the name, regardless of what we call it, seems to change

Re: Proposal: Use of Realm Instead of RealmId

2025-01-29 Thread Yufei Gu
Having a consistent name across the system is a huge benefit for users and developers. There would be less confusion and less cognitive burden for everyone. Otherwise, people may keep thinking "realm" and "realmId" are different things. As I said in the proposal, the name "realm" is already widely

Re: Proposal: Use of Realm Instead of RealmId

2025-01-29 Thread Eric Maynard
> Renaming `RealmId` to `Realm` and then also add another `RealmXyz` type makes it difficult to distinguish, causing unnecessary more confusion. I didn't see another such type in Yufei's PR , unless you're talking about the ImmutableRealmId type you add

Re: Proposal: Use of Realm Instead of RealmId

2025-01-29 Thread Robert Stupp
Thinking more about this, having a huge change just for a nomenclature thing is really not worth the effort, so I'm against such a rename. On 29.01.25 11:02, Robert Stupp wrote: Let's take a step back. The documented contract of the old `RealmContext` was to provide the realm-ID from a REST r

Re: Proposal: Use of Realm Instead of RealmId

2025-01-29 Thread Robert Stupp
Let's take a step back. The documented contract of the old `RealmContext` was to provide the realm-ID from a REST request - nothing more, nothing less - that's all what's been implemented. And this is exactly the reason why the current type is called `RealmId`. Renaming `RealmId` to `Realm`

Re: Proposal: Use of Realm Instead of RealmId

2025-01-28 Thread Yufei Gu
Hi Folks, Thanks for chiming in! I agree that renaming while keeping the interface intact is the better option. I see realm more as an atomic concept, and renaming helps maintain consistency across the system. Please take a look at this renaming PR: https://github.com/apache/polaris/pull/899. Sin

Re: Proposal: Use of Realm Instead of RealmId

2025-01-27 Thread Robert Stupp
I'd prefer to keep RealmId for just the ID then, and add a separate Realm type when there's a use case for it in Polaris. Custom realm-specific additions can always produced when needed - e.g. using `@Produces @RequestScoped MyRealmData produceMyRealmData(RealmId id, OtherBeanOne one, AnotherB

Re: Proposal: Use of Realm Instead of RealmId

2025-01-27 Thread Dmitri Bourlatchkov
Good point about entity injection. I still have reservations, but I guess we can address any specific issues when we hit them. If we go with entity injection, I'd think the refactoring has to go beyond the class/interface renaming and aim at removing `Realm` method parameters. I believe Realm will

Re: Proposal: Use of Realm Instead of RealmId

2025-01-27 Thread Alex Dutra
Hi all, I guess we need to align our vision of what "RealmId" (or whatever we call it eventually) actually represents. Some of us seem to consider that this component is really just the unique identifier of a realm entity, pretty much like a primary key. Under that vision, the component is not ex

Re: Proposal: Use of Realm Instead of RealmId

2025-01-27 Thread Dmitri Bourlatchkov
Thanks for starting this discussion, Yufei! I think it is important to clarify this sooner rather than later. >From my POV option 2 (String) is cumbersome. The biggest reasons being more complex CDI injection (as already noted by other people) but also more complicated usage searches in IDEs. As

Re: Proposal: Use of Realm Instead of RealmId

2025-01-27 Thread Robert Stupp
I think, we should stick with `RealmId` as it clearly means "this is the ID of a realm". It is also a concrete type and can therefore unambiguously @Inject'ed - whereas using CDI qualifiers for simple types like j.l.String does not work well in practice. I do not mind having another type or se

Re: Proposal: Use of Realm Instead of RealmId

2025-01-25 Thread Jean-Baptiste Onofré
Hi Yufei Thanks for starting this discussion. My preference is for option 1, both for the naming but also because the interface can host additional "functions" for the realm (in the future). Regards JB On Sat, Jan 25, 2025 at 2:51 AM Yufei Gu wrote: > > Hi Folks > > I wanted to share my though

Re: Proposal: Use of Realm Instead of RealmId

2025-01-25 Thread Alex Dutra
Hi Yufei, Thanks for opening this discussion, I agree that we could improve the naming. I have a slight preference for Option 1, first because it's more extensible: realms could maybe require more properties one day, e.g. a state (initializing/active/inactive/deleted). But also because using stri

Proposal: Use of Realm Instead of RealmId

2025-01-24 Thread Yufei Gu
Hi Folks I wanted to share my thoughts on the ongoing discussion in PR #741 . about whether to use Realm or RealmId. The more I consider it, the more it seems that the name Realm is the more natural choice. It is more an atomic concept, much like the co