Question on formating data in a file
Posted on 2004-03-27
Hello, I'm building an GUI address book that allows you to add new addresses, delete addresses and edit addresses entries. If you edit or add new addresses an another UI comes out allowing you to add in all details about the new address or the address that the user decided to edit. With the address comes other details about the address for example (the person who lives at this address, phone number, work number, etc...). Now my question what would be a better way to hold and collect the data. I was thinking of the the following two options:
Option 1: Read some data from a file - If I do this options I don't how to format the data in the file so when I read the file in Java it will collect all the data and associate it with the right variable names
Option 2: Build a vector that is empty and associate columns to all the variables - My thinking around this comes from database systems. In database systems all you would have to do is build a table with columns that represent a group of data and everytime that you enter in some new data the table would grow in rows.
If anyone can help me with this problem that would be great. Just to clarfiy I am using swing widgets . thanks!