• Post Reply Bookmark Topic Watch Topic
  • New Topic

DTO must implements Serializable?  RSS feed

 
Catherine Shan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I create a data transfer object class in order to tranfer data between web tier and business tier,if I ensure they run in one physical server and in one application,and the business handler is a common class,not EJB.then could DTO do not implements serializable?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm thinking if it doesn't need to be serializable it doesn't need to exist. DTOs exist only to Transfer data between components that can't share "real" objects. (I define DTO as equivalent to C structs, data only, no behavior, not much of an object.) If your web-to-business call is a perfectly ordinary java method call, can't you just pass a perfectly ordinary object?
 
Catherine Shan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see.I greatly appreciate your help.

Originally posted by Stan James:
I'm thinking if it doesn't need to be serializable it doesn't need to exist. DTOs exist only to Transfer data between components that can't share "real" objects. (I define DTO as equivalent to C structs, data only, no behavior, not much of an object.) If your web-to-business call is a perfectly ordinary java method call, can't you just pass a perfectly ordinary object?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!