Hard Prerequisites |
|
You are required to create a back-end service that will help capture basic information about prospective students who come to inquire here at Umuzi. In this project you’ll just be storing and retrieving information from plain old txt files.
Create the following functionality in a TDD way. And make sure that everything has the correct Exception handling and those exceptional cases should have tests as well. In an error occured it through
save
that saves the visitor’s data to a Text file. The file name should be named like this visitor_{their_full_name}.txt
.On a successful save, a log to the console should be made using log4j and the same when an error occurs;
alice.save() # results in visitor_alice_cooper.txt
bob.save() # results in visitor_bob_marley.txt
charlie.save() # results in visitor_charley_sheen.txt
Notice that the full name used in the file is all lower-case and spaces are replaced by underscores.
load
that takes in a name and then grabs a Visitor object from file. It should simply System.out.println
the visitor.On a successful read, a log to the console should be made using log4j and the same when an error occurs;
eg:
alice.load("Alice Cooper")
// prints out all of Alice's information
bob.load("Bob Marley")
// Same deal for good ol Bob