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

  • En attendant avec impatience le cru 2014 de la conférence Scala.IO, j’ai récemment regardé la présentation ‘Trouble with Types’, de Martin Odersky. Elle a ...
    51 minutes ago
  • First you will need to load both: the Bean Validation and EL SPIs. Hibernate Validator is the Reference Implementation (RI) for Bean Validation, and Glas...
    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