Storing Large Amounts of Dictionary-Like Data Within an Application in Java
I fear I may not be truly understanding the utility of database software
like MySQL, so perhaps this is an easy question to answer.
I'm writing a program that stores and accesses a bestiary for use in the
program. It is a stand-alone application, meaning that it will not connect
to the internet or a database (which I am under the impression requires a
connection to a server). Currently, I have an enormous .txt file that it
parses via a simple pattern (Habitat is on every tenth line, starting with
the seventh; name is on every tenth line, starting with the first; etc.)
This is prone to parsing errors (problems with reading data that is
unrecognizable with the specified encoding, as a lot of the data is
copy/pasted by lazy data-entry-ists) and I just feel that parsing a giant
.txt file every time I want data is horribly inefficient. Plus, I've never
seen a deployed program that had a .txt laying around called "All of our
important data.txt".
Are databases the answer? Can they be used simply in basic applications
like this one? Writing a class for each animal seems silly. I've heard XML
can help, too - but I know virtually nothing about it except that its a
mark-up language.
In summary, I just don't know how to store large amounts of data within an
application. A good analogy would be: How would you store data for a
dictionary/encyclopedia application?
No comments:
Post a Comment