Skip to content

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.

Notifications You must be signed in to change notification settings

driko-development/Telephone-Listing-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Telephone-Listing-Application


Goal

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.

Description of how the code works

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.

Commands

  • 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

Prerequisites


Installing .NET on Linux

This project is tested on Ubuntu 20.04 LTS, but other linux distros are supported.

See the Microsoft documentation for Linux Distributions.

Installing and Setting up SQLite

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
);

Compilation and Execution


  1. cd into the Telephone-Listing directory
  2. dotnet run - to compile and run the program
  3. read the program usage and run the commands
    Note: The dotnet CLI will not work unless inside the CSProject root folder.

Assumptions made


  1. The user is able to set up the SQLite Person database with Person table
  2. The user does not enter duplicate information, to reduce SQL setup complexity no key constraints added
  3. When deleting a person, the same input used to create the person is used (name or phone #)
  4. Assuming the user creates the SQLite database in the root folder of the CSProject
  5. Assumes the user changes the permissions and ownership of the log file and configuration file

Pros / Cons


Pros

  • Utilizes Dependency Injection for configuration files and logging functionality.
  • SQL injection protection via parameterized SQL queries

Cons

  • 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

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages