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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:41:51+00:00 2026-06-14T00:41:51+00:00

My recent exposure was mostly to non OOP languages, so wonder any pattern or

  • 0

My recent exposure was mostly to non OOP languages, so wonder any pattern or practice to do the below.

I need to write a function, which takes a json string (json array of objects) and produces list of objects (say Student). I checked the creational patterns, but doesn’t seems to fit. Do you think I should write a helper class just to create these objects.

  • 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-06-14T00:41:52+00:00Added an answer on June 14, 2026 at 12:41 am

    If you have a kind of util class already, this kind of function would fit nicely in that class. I wouldn’t make a completely separate class just for this. For instance, something like:

    public static List<Student> parseJsonToStudents(String jsonData) ...
    

    You could, however, have a constructor in your Student class which accepts a json String as a parameter and constructs the Student object from that. That would definitely be taking advantage of OO principles. But the GSON package renders a lot of that kind of thing obsolete and you might not want to bother programming it yourself. It has in it fromJson() and toJson() methods which will parse the data and construct the objects for you.

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

Sidebar

Related Questions

A recent homework assignment I have received asks us to take expressions which could
For my recent project I need to work with as1. The problem is that
HTML parser...My recent project needs a web spider..it automatically get web content which it
Recent commits reference TLS progress. Any idea when it will be ready? If not,
In recent reading, I see conflicting recommendations on encapsulation methods and OOP best practices.
In a recent programming interview, I was asked an SQL question to which I
Most recent problem is Third Error listed below. I am working on an application
Very recent i have to complete a project which have a small portion of
A recent question here made use of the default keyword in non-generic code that
In recent versions, OpenCV allows easy creation of keypoint detectors, descriptors or matchers using

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.