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).


No comments:

My favorites blogs

  • Retour sur la Journée DevOps organisée dans nos locaux le 10 juin dernier. L’objectif de cette matinée, dédiée au mouvement DevOps et au Continuous Deliver...
    5 hours ago
  • In the interview I said: "The JavaOne is the only conference, which I attend as a speaker" what I meant was: " an attendee". Sorry, but it was lat...
    1 week 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