DDD: how to keep a complex value object immutable? <p>I'd like to model an <code>Address</code> as a value object. As it is a good practice to make it immutable, I chose not to provide any setter, that might allow to modify it later.</p> <p>A common approach is to pass the data to the constructor; however, when the value object is pretty big, that may become quite bloated:</p> <pre><code>class Address { public function __construct( Point $location, $houseNumber, $streetName, $postcode, $poBox, $city, $region, $country) { // ... } } </code></pre> <p>Another approach whould be to provide the arguments as an array, resulting in a clean constructor, but that might mess up the implementation of the constructor:</p> <pre><code>class Address { public function __construct(array $parts) { if (! isset($parts['location']) || ! $location instanceof Point) { throw new Exception('The location is required'); } $this-&gt;location = $location; // ... if (isset($parts['poBox'])) { $this-&gt;poBox = $parts['poBox']; } // ... } } </code></pre> <p>That also looks a bit unnatural to me.</p> <p>Any advice on how to correctly implement a pretty big value object?</p>