[TYPO3-mvc] Blog Example and Value Object question

Michael Knoll mimi at kaktusteam.de
Sun Dec 27 23:10:31 CET 2009


Hi Masi,

without looking at the blog-code, I would say that "Tag" cannot be a 
value object. Like written earlier in your last discussion, "sex" could 
be a value object, as it has only two states "male", "female" that don't 
change over time, need not be persisted etc.

A tag has a "tag-word" as a state, so there are as many possible values 
as there are words. So in my opinion it's no value object!

Greez

Michael





Martin Kutschker schrieb:
> Hi!
> 
> If I understand correctly then value objects are immutable, or at least should be. Wouldn't that
> mean that ideally all attributes are set in the constructor? Yet the tag class in the blog example
> has no constructor but a setName() method.
> 
> Masi


More information about the TYPO3-project-typo3v4mvc mailing list