Question about circular references
David Alayachew
davidalayachew at gmail.com
Mon Jul 3 16:59:44 UTC 2023
Hello Vicente,
Thank you for your response!
> The question about record's mutability has been asked
> several times actually in this same list there are some
> previous ones asking for this same issue.
I think you may have misread my post Vicente.
Let me be clear here -- I do not want records to be mutable. That is not my
goal at all with my post. Mutability would make my situation much WORSE
because mutability would result in my model inaccurately representing how
the control flow works.
The purpose of my post was to see if anyone felt the same about how
circular references are forced to work in Java. As is, I see no way to have
circular references while maintaining immutability and direct references.
You must either do it through reflection, or sacrifice either immutability
or direct references. I wanted to know if anyone else was bothered by that
fact and felt it was a problem that should be solved.
> As a reference there is a very interesting one covering
> this one an other issues related to records [1] and
> please see Brian's answer [2] which as mentioned covers
> not only mutability but other topics too.
>
> Thanks,
> Vicente
>
> [1] https://mail.openjdk.org/pipermail/amber-dev/2020-April/005900.html
> [2] https://mail.openjdk.org/pipermail/amber-dev/2020-May/005972.html
Indeed, both links are very interesting, but they are entirely orthogonal
to my post.
My post is discussing my pain points with how circular references are in
Java, and "querying the crowd" to see everyone else's thoughts on whether
or not this is a problem worth solving. They are talking about a list of
want-to-haves for records, followed by a detailed explanation from Brian on
why those are not (currently) viable.
The reason I added the amber list is because in this case, I found a
dictionary-definition use case for records, but I am unable to use them
there because of this circular reference problem. I felt that the amber
team might find value in discussing this too, since this prevents records
from being used for their defined purpose.
Thank you for your time!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230703/162ea77b/attachment.htm>
More information about the amber-dev
mailing list