Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:54:46+00:00 2026-05-26T08:54:46+00:00

I work on an web application that uses JPA/EclipseLink together with Spring and Tapestry.

  • 0

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,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:54:46+00:00Added an answer on May 26, 2026 at 8:54 am

    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:

    1. when you’d need a composite object to be used in the GUI layer which doesn’t need (or can) use the fields directly from the JPA entities (i.e. combines data from different objects or uses only a part of the data and you don’t want to let the client to access some other parts)
    2. when you’re using the Domain Driven Design where the business logic is built around your entities. In this case, your entities are not simple Java Beans but fully fledged business logic components and therefore you might not want to expose them directly to the client.

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I work on a web app that uses some Spring Application Event publishing and
I work on an iPad application that has a sync process that uses web
I am developing a web application that uses JSF 1.2 for the view layer.
I am building a web application that uses a lot of Javascript. Now I
I work on a web application that modifies a XML document that is stored
I have a web application that I'm working on for work and its not
background: I work on an asp.net web application that is on a company intranet.
I ask this because at work I am supposed to develop a web-application that
I have a mobile web application that uses the Javascript SDK to connect to
I am working on Web Application that uses Google map. I need to verify

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.