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

B&S: Design Choices: Reading Datafile

 
amer khalid
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I guess it would be good idea to share my design choices. It may help others. Also I welcome your critic of my choices.

Data file contains number of field per record which make me think there could be variable number of fields in database. However, I am going to assume that there are going to be always 6 fields and I am hardcoding those fields.

I seen that others have done same thing.

Thanks

Amer
 
Markus Hopper
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amer,

i did it with a dynamic file header - and got full points for the dabase server.
i saw other here, who did it hardcoded.
i guess this is enough, because you should do it as simple as possible.

hope that helps,
greetings, Markus
 
amer khalid
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Markus... I am hardcoding... but I check for the field lengths and names... if it is not what the specs says, i error out... i read here someone else did it same way...

I have made another design choice... if database file contains a record marked deleted, i simply don't read it at all, don't increment RecordNumbers at all. If application is closed with out making any modifications to database, then I simply delete the database file and save what I have in the memory. This way all the deleted records are removed from the the database file.

Another design decision I made is that when Application starts, it creates a temp lock file, when application stops it deletes that file. If application starts and see that lock file already exists, it means application had crashed during the last run and the data may not be valid in the database file. It will prompt an warning and let user proceed at user's risk.

thanks

-amer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic