[FLOW3-general] How to use value objects

Robert Lemke robert at typo3.org
Wed Feb 23 09:13:27 CET 2011


Hi Lukas,

Am 22.02.2011 um 08:21 schrieb Martin Kutschker:

> Am 08.02.2011 19:33, schrieb lukas lentner:
>> 
>> 3. Why do I need to give every value object an constructor?
> 
> I don't know if there are technical reasons, but as value objects should be immutable they will have
> usually no setters.

yes, correct. A value object without a value doesn't make sense. But because a value object must be immutable, we force you to use a constructor for passing the values. If that's a problem in real life we need to discuss this, but we thought that it makes sense.

Cheers,
Robert


More information about the FLOW3-general mailing list