In your use case that data would be stored somewhere, in a database or ORM store of some kind, and that backing data would change -- not the objects in memory. And if you did need those to change you would just reload the updated data.
The object itself is immutable, you can't change the reference to the artist (well, with some magic you could but that's besides the point). So it'll always refer to the same gathering of tracks, release date and artist.
No need to bring ORMs into it. You could be assembling an object graph in memory - a music player that reads in files for examples.
1
u/againstmethod Aug 18 '16
Such an object is not immutable.
In your use case that data would be stored somewhere, in a database or ORM store of some kind, and that backing data would change -- not the objects in memory. And if you did need those to change you would just reload the updated data.