Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data conversion tool

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have recieved my fly by night developer project and i have a few questions on the data conversion tool design. i think that there are two ways that i can go about building this. my first way would involve just a simple command line program that takes in the details by argument such as
1. database location.
2. datafile location (given by project).
3. comma delimeted names of the fields
the lengths of the fields could be found from the file by just getting the largest field lengths. the program would validate that the number of fields given in the arguments is correct.
the other way would be to go over board and create gui's for the insertion of data. has anybody else created a conversion tool in the same way and is satisfied or should i be looking to make the tool more user friendly.
thanks in advance.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes for the data conversion tool i have created a GUI to insert the data and that inturn uses the Data Class and inserts the data into the flat file. I have not used any networking for this data conversion utility tool. This is the way i have done. if this idea is wrong, i would be thank ful if some one gives a better idea
 
Greg Belyea
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am in the exact same stage of my FBN developers project. From what I have read I understood the conversion tool to be an instrument that with a command line entry can convert a flat file to binary, and vice versa. If you give the conversion tool gui and have it create bo flat file and bin, then are you fulfilling the objective??? Will you be able to use this tool to write your deleted records back to your flat file later in the project, or will you have to open up the tool to delete unwanted records??? That sounds confusing?
I am definitely interested in explanations and the decisions you guys are making though, it is good that there are other people in the same stages on this thread. I am trying to come up with a design for my conversion tool today.
Greg
 
Ashwin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just completed my assignment and am about to submit it.
In my assignment, the data convertor tool has a GUI that accepts the input file name, output file name and other relevant parameters. It assumes that the flat file is in the proper format and tries to do the conversion. Personally, I believe that it should not make a difference if the tool is GUI-based or command line. Only minor advantage the GUI has is that it looks better and presentable.
"Will you be able to use this tool to write your deleted records back to your flat file later in the project, or will you have to open up the tool to delete unwanted records??? That sounds confusing?"
I am not able to understand the above. Could you elaborate? As far as I know, you do not need to delete any records from the flat file at any stage of the project. Correct me if I am wrong.
Ashwin.
 
Jeff Young
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate on "other relevant parameters"? In my conversion utility, I have only the 2 file names as parameters, which I kind of don't like since it's not very extensible. However, I didn't want to have a ton of required parameters like the field names and lengths, since that wouldn't be very user friendly. Any thoughts?
Jeff
 
Ashwin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my project, the following are the "relevant" parameters.
1) Inout file name.
2) Output file name
2.5) Delimiter.
3) Number of fields.
4) Names of Fields and their lengths.

The reason for the last two parameters.
I have assumed that this tool would in effect be creating a table(in DBMS) or similar to it where you will have to provide that kind of info.
Thus, using this analogy, the user would be asked to enter the number of fields, their names and their maximum length. This thus, lets the application to be extensible and could be used with any other database (with the same format) with maybe, different field names, types etc.
I have tried to make the Data Convertor as generic as possible.
Ashwin.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just finished my Data Conversion tool and have adopted this method. I have built a class called FileFormat that has the default field names and length as given now with methods to add and delete fields. The Data Conversion tool uses this format class(to obtain fieldnames and field lengths) and 2 command line args to get the location and filename. What do you think about this approach?
Originally posted by Ashwin:
In my project, the following are the "relevant" parameters.
1) Inout file name.
2) Output file name
2.5) Delimiter.
3) Number of fields.
4) Names of Fields and their lengths.

The reason for the last two parameters.
I have assumed that this tool would in effect be creating a table(in DBMS) or similar to it where you will have to provide that kind of info.
Thus, using this analogy, the user would be asked to enter the number of fields, their names and their maximum length. This thus, lets the application to be extensible and could be used with any other database (with the same format) with maybe, different field names, types etc.
I have tried to make the Data Convertor as generic as possible.
Ashwin.

 
gemini kenny
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My conversion tool is also similar to the above but only thing it doesn't sound very generic(esp. getting field names and lengths).
How do we make it more generic
i) by not passing too many parameters and
ii) satisfy the condition that "the conversion tool should be working for projects in future?"
Thanks
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gemini:
My conversion tool is also similar to the above but only thing it doesn't sound very generic(esp. getting field names and lengths).
How do we make it more generic
i) by not passing too many parameters and
ii) satisfy the condition that "the conversion tool should be working for projects in future?"
Thanks

I did it like i mentioned earlier. I created a file format class with the default fields given to us and providing methods to add and delete fields. So in the future when somebody wants to change the file they can subclass the fileformat class and build the file. The data Conversion tool will then use the new format and convert. This i think is better then specifying all fields and lengths as command line parms. The other way of creating an UI looks cool too.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
what do you think about using converison tool for importing additional ASCII file, in the same format, which contains field names and lengths, and will create FieldFormat object?
In this way you won't need to enter so many parameters each time you run conv tool and it still could be simply changed by editing ascii file.
 
Kate Green
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An additional ASCII file with the field names and maximum lengths is a good idea.

I was going to use a GUI requesting text file name, database file name and data delimiter and then reading the text file and working out the no. of fields and their maximum lengths. I would then display this information and allow the user to enter field names and to increase the field lengths if necessary. I was a bit worried that this would be against the rule that the examiner should not have to do any editing.
A predefined file with field names and lengths would get around this problem. Anybody else agree ?
 
Greg Belyea
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah I agree, I finished my converter and used two command line arguements. so I run it like
java DataConverter whatever.txt whateverelse.bin
so it takes my ascii file named *.txt(* being whatever you called it) and writes a file called *.bin (* being whatever you want your bin file to be);
then I have a command line prompt that says "How many Columns in your database?">
They answer whatever and I have a GUI that pops up with the proper number of Textfields to enter column names and max field lengths.
Then as long as they fill it in properly it writes the file. I thought this way way very open to recycle and reuse. It works for any asc file.
I am interested in a few things though what methods did people pick in order to replace the depricated writeBytes() in the Data class??
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the property file instead to get the information needed.
 
Forrest Xu
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on fly by night developer project and i have not seen any requirements of the data conversion tool in my application submission.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java2de, first that is an onld version of the assignment, look at the original post, that was over a year and a half ago.
Don't worry. Oh, and Javaranch has a policy of registered users using their first and last names rather than having Aliases.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic