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

  • 1. What do you think about play framework as compared to JavaEE ? I often heard that JavaEE is heavyweight in development and therefore inter...
    1 hour ago
  • Dans les grandes sociétés françaises, on entend de plus en plus parler d’Agilité, ou encore de transformations Agiles. Une transformation Agile est un véri...
    1 day 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