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