Produce a command-line driven telephone listing program. The program shall be capable of receiving and storing a list of people with their full name and telephone.
The code starts by doing input validation on the command line arguments. It is during this initial set up that the regular expressions are used to validate the input.
After successful set up, then using the TelephoneListingService the specified command is run using its corresponding parameters.
The ListingService utilizes a SQLite Person database with Person table to keep track of people in the telephone list.
- ADD <Person> - Add a new person to the database
- DEL <Person> - Remove someone by name
- DEL <Telephone #> - Remove someone by Telephone number
- LIST - Produce a list of the members of the database
This project is tested on Ubuntu 20.04 LTS, but other linux distros are supported.
See the Microsoft documentation for Linux Distributions.
See the following tutorial on how to install SQLite on Ubuntu.
Run the following commands inside the project folder "TelephoneListing" to create the Person database table
sqlite3 person.db3
sqlite> CREATE TABLE Person( Name VARCHAR(255) NOT NULL, PhoneNumber VARCHAR(255) NOT NULL
);
- cd into the Telephone-Listing directory
- dotnet run - to compile and run the program
- read the program usage and run the commands
Note: The dotnet CLI will not work unless inside the CSProject root folder.
- The user is able to set up the SQLite Person database with Person table
- The user does not enter duplicate information, to reduce SQL setup complexity no key constraints added
- When deleting a person, the same input used to create the person is used (name or phone #)
- Assuming the user creates the SQLite database in the root folder of the CSProject
- Assumes the user changes the permissions and ownership of the log file and configuration file
- Utilizes Dependency Injection for configuration files and logging functionality.
- SQL injection protection via parameterized SQL queries
- Not much exception handling especially when dealing with the SQL statements, due to time limitation.
- Regular expressions do not match all inputs
- Due to dotnet not creating an executeable hard to change ownership and permissions