I work on an web application that uses JPA/EclipseLink together with Spring and Tapestry.
As of now, my web layer retrieves and displays the JPA entities directly without using any DTOs.
Is this a good idea? What are the pros and cons of my solution? What are the alternatives? Should I bother implementing DTOs?
Regards,
The JPA Entities are a plain POJOs and therefore (in a detached state) are a perfect example of a DTO. I wouldn't bother creating another layer of abstraction if it's not absolutely necessary.
The situations, on top of my head, in which you might consider using explicit DTOs are:
Always ask yourself a question - what it gives to you to introduce another layer of abstraction and if it's necessary in your particular case.
HTH.