A more advanced app for creating a directory of students enrolled on the WDI course, backed by a SQLite3 database.
- cd into projects/StudentDirectory
- Add a remote called dmgarland and pull my latest code
git remote add dmgarland https://github.com/dmgarland/StudentDirectory.git
git pull dmgarland database
- Change to the database branch:
git checkout database
- To run the program:
ruby student_directory.rb
- To run the tests:
ruby test/person_test.rb
ruby test/student.rb
ruby test/instructor.rb
- Fix the people test, so that you can create Student or Instructor objects out of the information in the database.
- Change the student_directory.rb program so that when I press 'p' from the menu, I see a list of everyone in the database, and all of their attributes.
- Fix the student test, so that you can persist a Student object to the database. Check that it works using the test provided and the sqlite3 command:
sqlite3 test/test.db - Do the same for instructor.
- Try your changes out in the main student_directory.rb program, so that you can save multiple students and instructors to the student_directory.db database, and see the results using sqlite3.
- Fix the person test so that you can search for people in the database when I select 's' from the menu. Improve your method so that it can return a partial match, e.g. if I search for "a" I want to find "Dan".
- If you've got this far, improve your code so that I can delete a person when you provide me with his primary key.
- If you're still stuck for something to do, how about improving the program so that I can edit the code that's there?
- If you get this far, see if you can port your existing student directory over to use a SQLite3 database and see if you took the same approach as I did.
- Brownie points for people with the most object-orientated approach. Where can your code be refactored and refined?