Aug 27th, 2005, 06:24 AM
spring web and business layers interaction
We have an MVC application. we're using DTO objects at web layer to collect and represent data on web forms. we also have a business layer, whose API is based on DOMAIN objects (not DTOs).
Is there any mechanism(best-practice, sample) in springframework, to provide this kind of translation (between dtos and domain objects)?
thank you , any comments welcome
Aug 27th, 2005, 06:59 AM
Springs DataBinder tries to avoid DTOs by making it possible to bind directly onto you domain layer beans. That way there is ofcourse no need for DTO <-> domain object translation. However, in some cases DTOs are a necessary evol. ASAIK Spring doesn't have direct support for this kind of thing, but take a look at the BeanWrapper, which could help you build a translator.
Aug 28th, 2005, 03:33 PM
This tool might help:
Also, the adapter pattern might help here.