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

  • Home
  • SEARCH
  • 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 6005443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:23:52+00:00 2026-05-23T01:23:52+00:00

Suppose you are working with some data, which comes from a JSON file. You

  • 0

Suppose you are working with some data, which comes from a JSON file. You read the file, parse it, make sure all needed variables are there and provide accessor methods to retrieve what’s needed. You reader/ parser .class name is A.

Once you’re done with all the above, you need to do something with the data. To handle this, there is additional class, lets call it B.

At this point do you:

a) Have B retrieve all that it needs from A and do whatever it needs with it

b) Have A create a clean bean C, which will have nothing to do with JSON and will only contain getters and setters for data, B will need to work with it. Once C is created, it will be passed to B, which will handle it.

I can make arguments both for and against each (a) and (b). Please let me know what approach is preferred from the height of your experience.

Assume:

  • Performance is not a concern
  • Clarity and maintenability is top
    priority
  • Tomorrow, data may come from a
    different source. It will continue to remain in JSON format
  • 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-23T01:23:53+00:00Added an answer on May 23, 2026 at 1:23 am

    It’s more of a design decision.

    (b) IMO. A is then a Factory pattern and can/should be somewhat agnostic of the data in JSON and you can use it on different files to produce beans with the right fields. You could even generate custom bean classes for different data sets.

    (a) solution is only viable if your data is very small and rather static, as far as the fields are concerned.

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

Sidebar

Related Questions

So i am working with some email header data, and for the to:, from:,
I made some CMS in PHP which manipulates with data from MySQL. In my
Suppose you're working on an enterprise project in which you have to get management
We are working with large amounts of data, all tagged in UTC (in Java).
Suppose we have 2 classes, Child, and the class from which it inherits, Parent.
In the library I'm working on, we have data sets (which may be subsets
I need to store some data in a file. FOR THE MOMENT each record
I have a button that grabs some data from the server using ajax, and
Suppose the app you are working on is specially designed for a customer to
I have only recently started working with the MVC approach, so I suppose this

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.