-
Notifications
You must be signed in to change notification settings - Fork 236
Mutable objects used for immutable values #772 #1596
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
base: main
Are you sure you want to change the base?
Mutable objects used for immutable values #772 #1596
Conversation
I like the removal of all the setters! |
I agree with Robert. I think this PR does not fully embrace the immutable pattern.
It would be good to explore the immutables library to address some of these points. Note that this PR contains a removal of some utility copy-constructors ( |
+1 to PolarisImmutables |
From the bug description I thought the point was to make those object not mutable, i didn't think there was a library already there hence why I created the builders. can you guys point me in the right direction thx ? @singhpk234 |
@fabio-rizzo-01 I think the ask is that you use this interface. Besides this, I think we should try to minimize the changes that callers need to make as much as possible. |
Looking at that interface and seeing where it is used, it seems to me that using it would require even more changes that what I already did. Taking PolarisEntityCore as an example, to convert that to an immutable object I'd have to create an interface (something like PolarisEntityCoreInt) that uses PolarisImmutable annotation, that would generate a class called Immutable PolarisEntityCoreInt. So all the code that is using PolarisEntityCore object it needs to be updated to use the new immutable object. Is this what you guys are suggesting ? @snazy @singhpk234 |
Updated Polaris entity objects to use builders instead of normal constructors and removed all the set methods to guarantee object immutability.
All the other changes are refactoring based on those changes.