By definition VO is a simple object.
By definition VO is a simple object.Well that's a very brad term. A better definition is cloning + equality not based on identity.
At any rate the name of the pattern doesn't matter,the point is in the immutability
Yes that is why I suggested not mentioning ValueObject at all and just add Copy suffix to method names doing this.
Actually calling it a ValueObject is also kind of wrong from the perspective that its not possible to enforce assign-by-copy off a specific class in PHP. Having a method that copies an object doesnt make it a ValueObject, since other methods may not have that behaviour and pass it by reference
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/CwRYT7NfhQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/55098A64.6010100%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.
Domain Driven Design is not meant to be applied to every software problem. It's explained clearly in the book, and it's even the first sentence on Wikipedia:
> DDD is an approach to software development for complex needs
I don't expect a PSR to be pushing DDD on all the PHP applications and libraries out there :)
The vocabulary of the meta document shouldn't be considered to be DDD vocabulary, and VO and related words shouldn't be considered equal to DDD VO, entity, etc... (and yes those words exist outside of the DDD world)
It is (against the definition):
"a value object is a small object that represents a simple entity"
by definition, a composed object is not a simple entity.
I missed the point in the discussion where it was decided they were value objects. Maybe it happened in a different mailing list, or on GitHub, I don't know. I don't even know how to search the mailing list to find it. If anybody knows where it was decided, please post a link)
But I wrote more than one month ago, in my last message on this subject, that they are NOT value objects.
I got no response.
I also feel this mailing list is quite useless, if discussion about PSRs is held on different media (github, other mailing lists, IRC, whatever).