Transfer or value object

  • Thread starter Thread starter Patrick Parent
  • Start date Start date
P

Patrick Parent

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 ?

Patrick
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top