5 ms·
Encapsulation is not identity. Immutable objects are still perfectly encapsulated, but they don't have identity, which is what the OP was asking about.
by naasking 10y ago
Encapsulation is not identity. Immutable objects are still perfectly encapsulated, but they don't have identity, which is what the OP was asking about.
- lacampbell 10y agoI do come across the view a lot that immutable objects aren't really OO. It's something I really don't understand - state that changes over time doesn't seem like a key ingredient to me at all.