Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Value Objects in which layer

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Value Objects or DTO is in Service layer or web layer.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Value Objects or DTO is in layer in which you need it. don't use this pattern if you dont need it - just overhead.
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asked in interview. Value Objects is in service layer or web Layer
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you get the job?
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you recall what a value object / DTO is (i assume you do know what this pattern is used for), then you'll probably find different scenarios and aspects in which you want to think about using DTOs. One possible aspect is security, another one would be performance, decoupling a third.

so my point is: you can use DTOs wherever you need them, in the service-layer as well in the web layer.
and my real point is: don't use them unless you have a very good reason to do so. unmotivated DTOs is an anti-pattern.

to answer your interview question:
service layer.

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry to hear ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic