Tell, Don’t Ask and Immutability in a non-directional network
I’m working on a small project in which I’m attempting to practice relatively strict adherence to two ideas:
Batching immutable object changes?
With immutable models, what would be the best way to batch several changes?
Why do mainstream OO languages not have immutability on class-level built-in? [duplicate]
This question already has answers here: Complete immutability and Object Oriented Programming (7 answers) Closed 9 years ago. I regularly write classes which can only have immutable instances, much like string. I am wondering why Java or C# or VB.NET don’t have immutability built-in into the language? That way, I can communicate immutability better to […]
Why do mainstream OO languages not have immutability on class-level built-in? [duplicate]
This question already has answers here: Complete immutability and Object Oriented Programming (7 answers) Closed 9 years ago. I regularly write classes which can only have immutable instances, much like string. I am wondering why Java or C# or VB.NET don’t have immutability built-in into the language? That way, I can communicate immutability better to […]
Why do mainstream OO languages not have immutability on class-level built-in? [duplicate]
This question already has answers here: Complete immutability and Object Oriented Programming (7 answers) Closed 9 years ago. I regularly write classes which can only have immutable instances, much like string. I am wondering why Java or C# or VB.NET don’t have immutability built-in into the language? That way, I can communicate immutability better to […]
Why do mainstream OO languages not have immutability on class-level built-in? [duplicate]
This question already has answers here: Complete immutability and Object Oriented Programming (7 answers) Closed 9 years ago. I regularly write classes which can only have immutable instances, much like string. I am wondering why Java or C# or VB.NET don’t have immutability built-in into the language? That way, I can communicate immutability better to […]
Why do mainstream OO languages not have immutability on class-level built-in? [duplicate]
This question already has answers here: Complete immutability and Object Oriented Programming (7 answers) Closed 9 years ago. I regularly write classes which can only have immutable instances, much like string. I am wondering why Java or C# or VB.NET don’t have immutability built-in into the language? That way, I can communicate immutability better to […]
How should I annotate, that a class is immutable in Java?
I recently stumbled upon how useful immutable objects are and that e.g. if you pass elements to a constructor and your class should be immutable, you have to copy these elements if they are not immutable themselves.
How would I isolate changes to mutable state if I need to run two queries to get the final result?
I’m working on some code that takes search criteria from a Rest API and uses it to query a remote API to return results. As an exercise, I wanted to try to separate all state changes to one place, as a language like Haskell would force you to (even though I’m programming in Java in this example).
How to refactor my project to have less mutable objects? [duplicate]
This question already has answers here: How does one decide if a data object type should be designed to be immutable? (9 answers) Closed 9 years ago. There seems to be a trend towards immutable objects, and functional programming. I recently got aware about the benefits of immutability. However, I am not very familiar with […]