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 6142875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:26:50+00:00 2026-05-23T18:26:50+00:00

I have various sets of Java objects, some of them pojos generated from JAXB

  • 0

I have various sets of Java objects, some of them pojos generated from JAXB tools, some of them domain classes etc.. In a large application, I need to get data from one set of objects and put into another set of objects which have different capabilities to use the data.

There are various methods of doing this: object mapping frameworks being an obvious choice. However, most of these frameworks with a solid code base and community, use reflection.(dozer for example)

I’ve been using a combination of adapters which adopt pojos and more complex java classes to visitor pattern, so that a visitor walking on the adaptor walks over one set of objects, and in the process creates another set of objects (the objects usually have parent/child/tree type of references) Especially when pass by reference is used rather than creating new Strings etc, this should be the fastest method available.

Can you think of any other method? Some sort of serialization to a byte array in memory, then deserialization maybe? Could it beat visitor based copies in terms of performance? Am I being unfair to reflection based approaches like Dozer? This is a key operation in the application, so any improvements are likely to improve overall performance significantly.

  • 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-23T18:26:50+00:00Added an answer on May 23, 2026 at 6:26 pm

    The visitor pattern should be pretty near optimal for performance. Anything involving serialization is going to be worse because of the overhead of any kind of generalized mapping.

    I’m not specifically familiar with dozer– but reflection doesn’t have to be such a huge hit if it is used essentially to automate the code writing you are doing by hand; that is, if it generates a class (or equivalent logic tree) a single time to define the copying operation and then runs this repeatedly. The reflection cost is amortized over a large number of operations and becomes negligible.

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

Sidebar

Related Questions

I have various settings in my ccnet.config file and wish to pass them to
I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL.
I have to improve some code where an Oracle stored procedure is called from
On my website I have various containers with content <div> s text in them.
I have a number of objects (containing various unique strings + variables) that I
I have an application where data sets can be filtered at various levels, and--for
I have a class that sets various session variables. After I set the session
I have a database which stores temperature-logging data from various instruments. Data may be
We have various php projects developed on windows (xampp) that need to be deployed
We have various servers that have many directories shared. It's easy enough to look

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.