3 ms·
Records seems very nice! What I wonder is if people are going to use them, considering Java is a bit old at this point and lots of code already exists. Refactor
by Zababa 5y ago
Records seems very nice! What I wonder is if people are going to use them, considering Java is a bit old at this point and lots of code already exists. Refactoring to use object would be a heavy cost. Maybe some new framework and ecosystems will appear based on new features of Java?
- ratww 5y agoRefactoring to use them is not really hard, as they are easily interchangeable with regular classes. They are pretty much syntax sugar for this class pattern here: https://stackoverflow.com/a/63615514 https://stackoverflow.com/a/63615514
- Zababa 5y agoThat's true, but that's still a large refactoring to do, especially with going from mutability to immutability. The community might also just not like them.
- dgb23 5y agoOn the other hand in some cases this type of refactoring might actually reveal design issues with the code, maybe even bugs.