This project has moved and is read-only. For the latest updates, please go here.

Is CustomersDTO class close to PEEA patterns?

Topics: Developer Forum
Oct 20, 2006 at 7:43 PM
In the CustomersDTO class I don't find the feature of the "Data Transfer Object" patterns. Is correct the patterns implementation?
In PEEA, if I have understood well, the DTO is a class "container" of simple data (string, int, ... not object) and low couple (no reference to Domain Model), easy to serialize and tranfer for example with remoting.

Thanks
Oct 23, 2006 at 6:03 AM
Fabio,
DTO is described as "An object that carries data between processes in order to reduce the number of method calls".
CustomerOperationDto does exactly this: It is an aggregator object that reduces the number of parameters (as quoted on PEAA: "One way to do this is to use lots of parameters")
It is true that in order to be fully compliant it should be serializable (as they should be all NSK entities) but we don't exclude to add this feature in future.
Also don't forget that patterns are "indications" of a possible solution, not "the" solution.
Oct 23, 2006 at 9:16 PM
Hi,
In the Uml class diagram example that describes the patterns (http://www.martinfowler.com/eaaCatalog/dataTransferObject.html) the class AlbumDTO (the same of NSK customersDTO), not contains the object Album (in the NSK, the object CustomersDTO contain the customer and all object for the persistence) but a simple string type (title and artist).
In IHMO, the DTO object is an aggregator of simple data (IHMO no object). So, the goal of "reduces the number of parameter" and "carries data between processes" is obtained.


Thanks for help in my NSK knowledge.