Hello Patrick,
>I was looking at this and I was wondering, it the value object only
contains property or does it also contains validation ?
Also If I have a relation between a Workorder and a Customer, should I
have a reference to a client or to an infoClient(value object) in the
workorder ?
I'm having a bit of a hard time guessing what your question may refer to -
out of the blue it's slightly confusing.
I'm trying to understand the question as being basically about DTOs (data
transfer objects) and in that case my answers would be no, the DTO
shouldn't contain validation logic and a DTO shouldn't contain references
to non-DTO objects. Probably I should add an "IMO" here somewhere, as I'm
sure somebody will have a different opinion - but I subscribe to the idea
that DTOs are purely containers for data that is being sent from somewhere
to somewhere else (hence no logic implementation in there) and that the
"web" of DTOs should be able to stand on its own, without any dependencies
outside that layer.
Oliver Sturm
--
http://www.sturmnet.org/blog