Sunday, January 27, 2013

In case of Dozer or BeanUtils are working well, you could have a design issue

Dzoer is an open source utils used to facilitate copying beans. BeanUtils is the Apache equivalent.

Both libraries are used heavily within JEE project to copy the data from the DTOs object to the domain model object(used to do the abstraction between the service layer and  the persistence layer/technology).

This kind of libraries rely on the CoC(convention over configuration). They are working correctly only if the attribute name are similar and the both DTO and business object have the same structure(name and sub elements).
In case of difference, the developer have to:
  • write configuration
  • specific mapping code.
In summary, if the mapping is working nicely with no need for configuration or specific mapping code, that is mean that we have to re think the domain model design (mean less separation if the domain model and the DTO is almost the same).


reference:
http://www.adam-bien.com/roller/abien/entry/in_case_dozer_or_beanutils


No comments:

My favorites blogs

  • Lors de cette session, Gojko Adzic a sans aucun doute réalisé l’une des meilleures présentations de ce Devoxx France 2014. Il annonce qu’il va nous donner...
    2 hours ago
  • The version 1.2 of the javaee7-essentials-archetype was released. Features: 1. Java 8 is the default compiler source and target 2. The name of t...
    6 hours ago
  • A previous post introduced some features of using Scala with Vert.x. This post covers how to publish Rest web services in an elegant and simple fashio...
    1 year ago