7
Back to Training Grounds
4.16

Immutability & Value Objects

When to make things immutable, value objects vs entities, defensive copying, and why Money should never be a plain number.

Introduction

Immutability & Value Objects

Half the bugs in LLD interviews come from mutating something you shouldn't. This section teaches you when to freeze things and why some objects should be compared by their contents rather than their identity.


1 / 7
1 / 7 β€” Introduction