Question
Java code project: Setting up structures to store and retrieve data. A major requirement of virtually all projects in the financial world involves the storage
Java code project:
Setting up structures to store and retrieve data. A major requirement of virtually all projects in the financial world involves the storage and retrieval of data. You will need this capability for the final (ultimate) phase of your project. Not every system is set up with the same capabilities. As such, your project must be properly modularized and allow for more than one way to store the data to satisfy the various needs of clients. The first manner is by storing data using hashtables (or hash maps) as the basis of storing and retrieving data. Remember to MODULARIZE properly.
The above discussion is the prerequisite knowledge. Now onto to more particular details. The goal of this phase is for you to demonstrate the ability to set up a data storage structure, populate it with data, modify the data (by updating values, deleting items and adding new ones) and querying the structure to find data that corresponds to your search parameters. A simple case of this would be setting up and maintaining an inventory for a grocery store. Inventory records would include the Name of the product, the selling price of the product, the quantity of the product currently in inventory, a threshhold on quantity indicating when to order more, a timestamp indicating when entered into the data storage structure and a unique inventory identifier or code. The truth is that there should be more parameters such the cost that you paid for the product and the last time the product was ordered amongst many other considerations. This brings us back to a point mentioned above: namely, I encourage you to think on your own and if time permits to add what you feel should be added in order that a better project can be presented.
On the command line the user can add a series of optional flags. A (unix) flag is in the form of minus single letter (or single word). For example,
-i input.txt will mean that there is an input file whose name input.txt can be found in the current directory. (If -i is provided without a specific file name then JFileChooser should be used so that the user can choose the file. See below.)
-o output.txt will mean to write an output file named output.txt in the current directory. This output file is a data dump of your storage into a delimited text file where each row will be one record of your inventory and each field of that record will be separated by |. The first line of that output file will be the headers for each field, also delimited. For example, the first line could be:
Inventory Number | Item Description | Quantity | Price | Date Purchased | Timestamp
1 | Oranges | 5 | 0.99 | 1-4-2017 | 1-5-2017
-d Path will mean do not read or write from current directory but instead read or write from/to files in the directory indicated by Path. -l log.txt will mean to maintain a log file named log.txt.
-v result.txt to verify data (to be discussed in the future). These flags may appear in any order. More flags may be added later in semester and you may add some of your own as you deem necessary.
In addition, it is traditional that the flag be case insensitive so -o and -O will both refer to designated output file, for example.
When starting up the project, two file names will typically be provided on the command line, one for input using the -i flag (ie to populate your inventory tables with initial data) and one for output using the -o flag (a data dump of current inventory holdings). If the file name is not provided, then instead a JFileChooser should be utilized.
The format of the input, output and log files are up to you and you should provide an accompanying Readme.txt file describing this format. The purpose of the input file is to provide the initial set of data. The purpose of the output file is to dump the data of the current inventory. The purpose of the Log file is that Every transaction with your storage structure be Logged into the output file. Logging means that in one line you provide the transaction name (INSERT, MODIFY OR DELETE with the corresponding parameters used) and if you use multiple structures or tables, then include the name of the structure or table you the current transaction interacted with. In addition, the Logfile should contain date and time of the transaction occurrence, for security purposes. In order to test your insert, modify or delete functions, you will need some sort of GUI that allows the user to choose which function they want and provide the parameters required by that particular function. In the case of QUERYing the data stored in the system, I will leave it up to you to decide to what extent you want to include querying in your project but you should minimal queries implemented: for example, indicating the last time an item was ordered, or what is current inventory or price history of an object.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started