Object-Oriented Design for Database and Add/Modify/Delete Module

 

(By Parag and George)

 

DATABASE:

 

Ÿ         The retriever (as shown in the diagram) would be a MySQL command handler that would execute the MySQL commands issued by the processor

Ÿ         The retriever would execute the get Majors, get Minors, get Core_Req, get Collegewide_Req, get General_Req, get User, etc commands issued by the methods in the processor and return the appropriate MySQL table

Ÿ         The retriever would also facilitate in adding entries through the add/modify/delete module using the same idea of executing add Majors, add Minors, add Core_Req, add Collegewide_Req, add General_Req, add User, etc MySQL commands issued by the add/modify/delete module

Ÿ         Example: execute msql “get Majors”

 

ADD/MODIFY/DELETE:

 

Login Page:

 

Ÿ         Contains the ‘help’ functionality that takes the user to the system manager’s manual

Ÿ         Contains the policy for using this module

Ÿ         Contains text boxes for username and password and a ‘submit’ button

 

Login:

 

Ÿ         Connects to the retriever and gets the table of users and passwords by issuing the ‘get Users’ MySQL command to the retriever

Ÿ         The combination of input from the username and password textboxes is checked with the entries in the User table to find a match

Ÿ         If the login is successful (a match is found) then the user is taken to the Present Menu page

Ÿ         Also, if the login is successful then store a session variable (which would be 1 if session exists)

Ÿ         If the login is unsuccessful then take the user to the login page (session variable still 0) and display a general error message (like ‘invalid username/password combination, try again’)

 

Present Menu:

 

Ÿ         Session variable checked whether it is set or not. Proceed if set otherwise display error message

Ÿ         Welcome ‘user’ message displayed

Ÿ         Connects to the database and retrieves all the table names and displays them in a drop-down menu.

Ÿ         Drop-down menu for all possible tables that exist in the database would consist of:

Ÿ         Username/passwords

Ÿ         Schools

Ÿ         Divisions

Ÿ         Departments

Ÿ         Degrees

Ÿ         Majors

Ÿ         Major requirements

Ÿ         Courses

Ÿ         Minors

Ÿ         Minor requirements

Ÿ         College-wide requirements

Ÿ         Transfer requirements

Ÿ         Core requirements

Ÿ         General requirements

Ÿ         Check boxes with operations that the user wants to do

Ÿ         Add

Ÿ         Modify

Ÿ         Delete

Ÿ         View

Ÿ         For modify/delete/view actions go to table display for the selected table

Ÿ         For add go to the input page

Ÿ         For add, pass the table-name for which you want to add an entry as an argument

 

Table Display:

 

Ÿ         Session variable checked whether it is set or not. Proceed if set otherwise display error message

Ÿ         Also, keep another session variable for the desired operation

Ÿ         Connects to the retriever and displays a nicely formatted table with all fields and records in the table

Ÿ         For modify/delete each entry in the table is preceded by a checkbox to select that entry for modify/delete action

Ÿ         Only one checkbox would be accepted, i.e. only one entry would be selected at a time for now (Javascript check)

Ÿ         A ‘delete’ or ‘modify’ button would be present at the bottom of this page pressing which would initiate the action

Ÿ         If ‘modify’ then go to the input page for making modifications to the existing entry

Ÿ         If ‘view’ then only the table is displayed with a button at the bottom that redirects to the menu page

 

 

Modify/Delete:

 

Ÿ         Session variable checked whether it is set or not. Proceed if set otherwise display error message

Ÿ         Javascript confirms the delete before performing the action

Ÿ         Connects to the retriever and executes the modify/delete command by passing an appropriate MySQL command to the retriever

Ÿ         Displays result of the action whether successful or not, check for errors and throws exceptions

Ÿ         Save the last operation and displays a button at the bottom of the page to repeat this action

Ÿ         Another button at the bottom of the page that redirects to the menu page

 

Input page:

 

Ÿ         Session variable checked whether it is set or not. Proceed if set otherwise display error message

Ÿ         Connects to the retriever and executes the add command by passing the appropriate MySQL command to the retriever

Ÿ         Certain fields in the input are textboxes, and others are drop-down menus

Ÿ         A parameter at the end of the field name in a table describes whether it should be displayed as a textbox or a drop-down menu

Ÿ         The field name is parsed to fetch this parameter and the field is displayed accordingly

Ÿ         The input from the text boxes is fetched and converted back to the code before inserting it into the appropriate table in the database 

Ÿ         Displays result of the action whether successful or not, check for errors and throws exceptions

Ÿ         Saves the major and the operation and displays a button at the bottom of the page to repeat this action

Ÿ         Another button at the bottom of the page that redirects to the menu page