Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Swing application or web application?

 
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Fellow Java Developers,

I want to write an application to input data for some items.

Each item requires about 25 fields of input data.

Initially I want to input and save the items' data in either property files (1 for each item) or xml files (also 1 for each item).  

At a later date, I want to read from the properties files or xml files and store in a database.

Now for the question:  

1) should I write a Swing application or a web application to input the data?

Many thanks for any suggestions!

-Ravi


 
Ranch Hand
Posts: 574
VI Editor Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you know the data ahead of time (that is, you won't be adding more in 3 months) it might be easier to enter the data into a text file, then write a parser to massage the text file into what you need.
 
Marshal
Posts: 76464
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ravi Danum wrote:. . . should I write a Swing application or a web application to input the data? . . .

Depends where you are entering the data. I think you should write an application that enters all the data from the keyboard first; then you can use a desktop app or a web app to access it.
 
Ravi Danum
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thank you both for your input.  

I will do this.  

I will write a Swing application, and initialize the fields with default values from a properties file.

After all data has been input for a given item, I will store it in a new properties file for the item.

When it comes time to store the data to a database, I will write a program to read data from each item's properties file and store to the database.

Your responses have been helpful in steering me to my design.

Many thanks!

-Ravi



 
Campbell Ritchie
Marshal
Posts: 76464
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ravi Danum wrote:. . . I will write a Swing application, and initialize the fields with default values from a properties file. . . .

No. As I told you, write a non‑GUI app first. Then add the GUI/web interface to it.
 
Rancher
Posts: 511
15
Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just few thoughts.

should I write a Swing application or a web application to input the data?



If the application and data is shared across users and locations a web app might be appropriate.

I will write a Swing application, and initialize the fields with default values from a properties file.



This sounds fine. JavaFX instead of Swing is an option.

After all data has been input for a given item, I will store it in a new properties file for the item.



Not clear why the data is being stored in a properties file. What is the amount of data (e.g., number of records or items) being stored initially? Why not in a plain text file or a CSV file.

When it comes time to store the data to a database, I will write a program to read data from each item's properties file and store to the database.



What happens if you have to enter new items then (later)? Where will this new data be stored? In the properties file or in the database? What happens if the data entered needs to be modified?
 
Ravi Danum
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello All,

Thank you very much for your responses.  

I have chosen to use Swing because I need to enter data for each item that includes links to photographs, lists, a choice selected from a list, choices selected from a list.  The field names are important to store with the data.  A csv file would not work in this case.

It seems a GUI makes user input easier.   Storing the data into a properties file (1 for each item) will be easy to read.

Each item entered can be thought of as a record; however, not all fields in a record will always have a value - in this case the name/value will not appear in the properties file.

I eventually want to store the data in MongoDB.

If I need to add new fields, that will work fine with MongoDB.  (It would not work with an RDB database).

I chose Swing over JavaFX because I'm working on Ubuntu and didn't download the oracle jdk8.  Only that one has JavaFX for Ubuntu.  The GUI I will write will contain only basic components.  I also know Swing to some extent and don't have much time to complete this project.

I apologize for not giving more details in my first question.

Again, thank you very much for the responses - this got me to reading more on the subject and thinking through the best solution for my project at this point.

Warm regards.

-Ravi




 
Ravi Danum
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello,

It is me again to say that I left out another detail in my first email:  none of the applications will be running remotely.

Originally I thought about writing a web application to input the data with tomcat running locally, but decided it would take a bit longer than I have.

Many thanks again for your emails and help.

-Ravi
 
Campbell Ritchie
Marshal
Posts: 76464
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ravi Danum wrote:. . . none of the applications will be running remotely. . . .

If you are running everything locally, then a desktop app like Swing or SWT or JavaFX sounds a good idea.
 
It's a tiny ad. At least, that's what she said.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic