• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving the user input as report  RSS feed

 
John Watts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my java application I want user to create reports, where user will enter date and name to text fields, and for several sections will choose radio buttons to indicate tru or false. After pressing send report button the report with input will be created which can be retrieved by other user. How this can be achieved? I have no time to learn database implementation. Should I create object or each report?  Is it better that each report would be a new object or would it better to write each report to I/O file  with some ID, and that ID would be added to some collection so other user can keep track of those reports and select one for viewing?
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are going to have to work that out; you would have to provide a lot more information. How many reports are there? How large are they? Can you fit them into one text file? There is something wrong about having lots of little files differing in their names; that was what databases are supposed to prevent. Do you know how to create a Report object and how to serialise it to a file?
I think providing that information will make it easier for you to work out for yourself how to record your reports.
 
John Watts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is only an  prototype which I need to make workin. Let say there will be only 20 reports. It doesn’t matter if all files are in one file, the important thing is that user would be able to extract information from each report that was submitted. Since I don’t have time to learn implementation of database, and you suggest creating many text files for each report is not good idea, then I have to create Report object, however I have no idea how to do it. Could you please outline how to do it?

What about creating separate object for each report and then serialise it?  
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have to write a report about your application? If so, make sure you discuss the decision about how you implemented report records, if you want good marks. What follows is the sort of points you will have to cover, but you will have to convert it into a more formal tone to fit the assignment.

What format do those reports take? Do they have several components? Can you create a class to encapsulate those reports? Do you know how to write them to a text file? What do you know about toString? Can you write a constructor/static factory method which can recreate those objects from the text? Can you read the text back from the text file? Can you put those reports into a data structure (look at this part of the Jav™ Tutorials)? Can you serialise the objects? If you put them into a data structure, is it possible to serialise such data structures?

Once you have written that section of the report, you will have much more of an idea how you want to implement your problem.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!