[TYPO3-mvc] Blog Example and Value Object question
Franz Koch
typo3.RemoveForMessage at elements-net.de
Mon Dec 28 13:01:59 CET 2009
Hi,
>> But to get back to your argument. I disagree, a tag is a value object
>> because its value cannot
>> change without changing its identity. So the choice is - as far as my
>> limited understanding of DDD
>> allows me to judge - correct.
>
> You are right. A Tag is a value object. It has no concept of identity. I
> only care about its name "Fruit". And I can pass it around without
> taking care which exact "Fruit"-object you have. It has no concept of
> uniqueness or identity.
I currently have the same issue on deciding whether I make my tags
entities or value objects. I'm asking this myself, because what if the
tags shall be displayed as tag-cloud, what if (to stay with the blog
example) the blog posts shall be displayed by a certain tag? Don't the
tags itself need to have an identity to resolve the relations to the
blog posts then? I only wonder how a "findPostsByTag" method for the
postsRepository would work then.
And what if I'd like to change the spelling of a tag, that is shared
across several posts (maybe because it was not the correct wording or
misspelled and not noticed) and I want the tag to be changed for every
related post? That would only be possible by entities, right?
--
kind regards,
Franz Koch
---------------------------------------------------
PayPal-Account: 'paypal _at_ elements-net _dot_ de'
---------------------------------------------------
More information about the TYPO3-project-typo3v4mvc
mailing list