|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Immutability with own by referenceHi, Just a quick one: if my class contains some sort of modifiable list then usually it would be considered mutable. But is that the case if my class doesn't actually own the lifecycle of that list? So for example if that list has "owned by reference" semantics and was supplied externally by some parent of my class and the list that it writes its results to. @Immutable?? class MyClass implements SomeCallback { List someList; MyClass(List someList) { this.someList = someList; } void onMessage(Message msg) { someList.add(msg); } } My hunch is that MyClass is immutable because the state is recorded in whichever class owns someList and we are just holding a handy reference to it. Is this reasoning sound? Many thanks - Ashley --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures. _______________________________________________ Concurrency-interest mailing list Concurrency-interest@... http://cs.oswego.edu/mailman/listinfo/concurrency-interest |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |