java - Value Object vs Data Transfer Object -


i part of 1 of project producing java webservice , publishing server. other java application consuming web service through extjs.

in producer application following domain driven design. using 2 types of pojos , domain objects , dto objects. both classes having same properties variables. , dto class implementing serializable class.

first creating domians objects db call , converting domains objects dtos , published in websevice.

now want know practice have these 2 types of objects ? why dtos implementing serialzable( one reason maintain state of objects while webservice call through network --- reason found in net, not clear me ) ?

any link or expert's explanation welcome.

thanks in advance.

objects made serializable able transferred. allows convert object bytes , bytes object.

note dto made lighter (since travelling client) domain objects have lot of attributes made business processing only.

so in multi-layer project can have example :

  • domain objects mapped database
  • a business layer process business rules
  • a transformation domain objects dtos
  • dtos transferred client

some reading:

http://www.oracle.com/technetwork/java/transferobject-139757.html

https://softwareengineering.stackexchange.com/questions/171457/what-is-the-point-of-using-dto-data-transfer-objects

difference between dto, vo, pojo, javabeans?


Comments