Title: The Online Grade Book
1The Online Grade Book
ACET 2003
A Case Study in Learning About Object-Oriented
Database Technology
- Charles R. Moen, M.S.
- Morris M. Liaw, Ph.D.
- October 18, 2003
2Why do we need OODB?
- When creating an application with an
object-oriented programming language - Objects can be saved without translating them to
another data structure - Vice versa, stored objects can be loaded without
translation - Efficiency and speed!
3Why do we need OODB?
- When creating an application that uses complex
data, e.g., building a space shuttle, creating an
electronic medical record system, storing
bioinformatics sequence information,
- Complex data can be stored without complicated
table schemas - Data can be retrieved by pointer traversal, no
need for time-consuming joins - Efficiency, speed, and complexity!
4Background Highlights
- Object-oriented database
- Persistent store of objects created with an OO
programming language - Advantages
- No need to convert objects to tables
- Capable of storing entities with complex
relationships - Fasterno need for joins
- Some important points
- No tables, no need for normalization
- Capable of computing transitive closure
- Relational databases are better for business apps
5How do we teach OODB?
- CSCI 5433 Object-Oriented Database Systems
- Prerequisites
- CSCI 3233 Object-Oriented Design and Programming
(C) - CSCI 5333 Database Management Systems (DB theory)
- Learning Goals
- Learn how to use OOAD for database development
- Learn how to use OO technology to develop an OO
database and a Web application that uses it as a
backend - Tools
- Object Modeling Technique (OMT)
- ObjectStore and MS Visual C
- Project
- The Online Grade Book
6Resources
- Textbook
- Object-Oriented Modeling and Design for Database
Applications
- Michael Blaha William Premerlani
- Prentice-Hall, 1998
- ISBN 0-13-123829-9
7Resources (Cont.)
- Software
- ObjectStore
- OO database management software
- Progress Software Corporation
- http//www.progress.com/
- http//www.objectstore.net/index.ssp
- Educational license available
- MS Visual C
- ObjectStore Wizards create C code
- Writing the callbacks
- Compiling the DLLs
8Resources (Cont.)
- ObjectStore Manuals
- Extensive PDF documentation
- The most important manuals
- Rapid Database Development
- ObjectForms Publisher Tutorial
- Inspector Tutorial
- ObjectForms User Guide
- C API User Guide
- Building C Interface Applications
9Resources (Cont.)
- Computer Lab
- Dedicated room with seven PCs
- PC configuration
- Windows 2000
- ObjectStore
- MS Visual C
- ObjectStore Mini Server
10Teaching Technique
- Lecture
- Intro to OODB
- Student presentations
- Based on textbook and ObjectStore manuals
- Project assignment
- Online Grade Book
- Personal home page with links to the project
- Exams
- Midterm and final
11Learning Goals
- Learn how to use OOAD for database development
- OMT Methodology
12OMT Methodology
Learning Goal 1 Learning How to Use OOAD
- Object Modeling Technique (OMT)
- Developed by James Rumbaugh
- Consists of
- Concepts about object modeling
- A process called the OMT Process
- Modeling notation
13The OMT Process
Learning Goal 1 Learning How to Use OOAD
- Conceptualization
- Analysis
- System design
- Detailed design
- Implementation
- Maintenance
14Learning Goals
- Learn how to use OOAD for database development
- OMT Methodology
- Learn how to use OO technology to develop an OO
database and a Web application that uses it as a
backend - Project assignmentOnline Grade Book
15Project Assignment
Learning Goal 2 Developing an OODB
- Create an Online Grade Book
- Web site where students can check grades
- The teacher will record the grades in an OODB
- Course grade calculated automatically, according
to weight percentages assigned by the teacher - OMT Process
- Conceptualization Report
- Analysis Report
- Project Report
- Implementation
- ObjectStore and C
- Final Demonstration
16OMT Process Steps
Learning Goal 2 Developing an OODB
- Conceptualization
- Business analysts or users conceive of an
application and list requirements
17Step 1, Conceptualization
Learning Goal 2 Developing an OODB
- Why is the Online Grade Book needed?
- Students can get grades without contacting the
teacher - Teacher will not have to contact each individual
student - What problems will it solve?
- Problem statement Develop software for an online
grade book using ObjectStore. The following
capabilities must be provided - Provide an automated system to show students
their grades - Allow the student to see his grades after
entering his ID - Display all the grades for that student,
including the midterm exam grade, the final exam
grade, the presentation grade, the group project
grade, the individual project grade, the course
score, and the course letter grade. - Permit the teacher to change all the student
data, including the name, password, and grades - Permit the teacher to change the grade weights
for the grade components
18Step 1, Conceptualization
Learning Goal 2 Developing an OODB
- What problems will it solve? (Cont.)
- Detailed software requirements (examples)
- The system shall have an ID for each user.
- The ID shall be an integer assigned to each
student in a class by the teacher. - The system shall provide a course ID for each
user. - The course ID shall identify the specific course
that the student is enrolled in, including the
course number, section, semester, and year. - The system shall check the ID of the user when he
wants to check his grades. - The system shall identify whether a user is a
student or an administrator. - Where will it be used?
- EnvironmentUHCL campus
- System requirements
- When is it needed?The end of the semester
19Step 1, Conceptualization
Learning Goal 2 Developing an OODB
- Who is the application for?
- Actors
- How will it work?
- Scenarios and use cases
20Step 1, Conceptualization
Learning Goal 2 Developing an OODB
Conceptualization Report
- 1 WHO IS THE APPLICATION FOR?
- 1.1 USERS
- 1.1.1 StudentDescription, Responsibilities,
Success Criteria - 1.1.2 Administrator Description,
Responsibilities, Success Criteria - 2 WHAT PROBLEMS WILL IT SOLVE?
- 2.1 APPLICATION OVERVIEW
- 2.2 PROBLEM STATEMENT
- 2.3 DETAILED SOFTWARE REQUIREMENTS
- 3 WHERE WILL IT BE USED?
- 3.1 ENVIRONMENT (e.g., UHCL classrooms)
- 3.2 SYSTEM REQUIREMENTS
- 3.2.1 Server Software (e.g., MS IIS, ObjectStore)
- 3.2.1 Client Software (e.g., modern Web browser)
- 3.2.2 Development Software (e.g., ObjectStore, MS
Visual C, Notepad) - 4 WHEN IS IT NEEDED?
- 4.1 PROJECT DEADLINE
21Step 1, Conceptualization
Learning Goal 2 Developing an OODB
Conceptualization Report (Cont.)
- 5 WHY IS IT NEEDED?
- 5.1 CONTEXT (e.g., class assignment)
- 5.2 OBJECTIVES
- 6 HOW WILL IT WORK?
- 6.1 SCENARIOS
- 6.1.1 Initial setup and addition of students by
the Administrator - 6.1.2 Adding the grades
- 6.1.3 Checking the grades
- 6.2 USE CASES
- 6.2.1 Use case diagram
- 6.2.2 Use case descriptions
- 6.2.2.1 View gradespreconditions, flow, post
conditions - 6.2.2.2 Edit student data preconditions, flow,
post conditions - 6.2.2.3 Edit grade weights preconditions, flow,
post conditions - 6.3 INITIAL ARCHITECTURE
22OMT Process Steps
Learning Goal 2 Developing an OODB
- Conceptualization
- Business analysts or users conceive of an
application and list requirements - Analysis
- Real-world models are constructed
- Specify what to do, not how to do it
23Step 2, Analysis
Learning Goal 2 Developing an OODB
- Attribute-based approach (not OO)
- Used with relational databases
- List attributes in related groups
- Check normal forms
24Step 2, Analysis
Learning Goal 2 Developing an OODB
- Entity-based approach (OO technique)
- Real-world entities and relationships between
them - Advantages
- Fewer entities than attributes
- No need to check normal forms
- Compatible with OO program code
25Step 2, Analysis
Learning Goal 2 Developing an OODB
OMT Methodology Models
26Object Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Start with the problem statement
27Object Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Start with the problem statement
- Locate nouns to find the entities for classes
28Object Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Eliminate unnecessary classes that are
- Irrelevant software, book, capabilities, system
- Redundant data, components
- Used only as values (attributes) grades, score,
ID, name, password
29Object Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Establish the models basic structure
30Object Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
31Object Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Add associations and refine the model
32Object Model Notation
Learning Goal 2 Developing an OODB
Step 2, Analysis
Class
Attributes
Inheritance
Multiplicity
Association
33Functional Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Start with the use cases
- View grades
- Edit student data (includes adding grades)
- Edit grade weights
- Straightforward object creation, deletion, or
retrieval? attribute value update?no need for
pseudocode - Use case 2 requires pseudocode for the course
grade, since it is calculated
34Functional Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
- Use Case 2 This is the pseudocode for setting
the course score and the course grade for a
student. They must be calculated, and the
calculations are triggered when the administrator
sets the students final exam score.
StudentsetFinal ( finalGrade ) self.final
finalGrade selfsetCourseScore(
) return StudentsetCourseScore ( ) score
0 score self.midterm self.weightTable.mi
dtermWeight score self.final
self.weightTable.finalWeight score
self.presentation self.weightTable.presentationW
eight score self.groupProject
self.weightTable.groupProjectWeight score
self.individualProject self.weightTable.individu
alProjectWeight self.courseScore
score selfsetCourseGrade( ) return
35Functional Model
Learning Goal 2 Developing an OODB
Step 2, Analysis
StudentsetCourseGrade ( ) if self.courseScore
gt 93 then self.courseGrade A else if
self.courseScore gt 90 then self.courseGrade
A- else if self.courseScore gt 87 then
self.courseGrade B else if
self.courseScore gt 83 then self.courseGrade
B else if self.courseScore gt 80 then
self.courseGrade B- else if
self.courseScore gt 77 then self.courseGrade
C else if self.courseScore gt 73 then
self.courseGrade C else if
self.courseScore gt 70 then self.courseGrade
C- else self.courseGrade F end
if return
36Navigational Flow
Learning Goal 2 Developing an OODB
Step 2, Analysis
- All pages in the Web site
- Block diagrameach page is a rectangle with a
descriptive name - All links between the pages drawn as directional
lines - Initial design of each page usually developed at
the same time
37Navigational Flow
Learning Goal 2 Developing an OODB
Step 2, Analysis
38Web Page Layouts
Learning Goal 2 Developing an OODB
Step 2, Analysis
39Step 2, Analysis
Learning Goal 2 Developing an OODB
- Analysis Report
- 1 NAVIGATIONAL FLOW BETWEEN WEB PAGES
- 2 WEB I/O COMPONENTS
- A list of the forms, buttons, and links for each
Web page - 3 WEB PAGE LAYOUTS
- The design of each Web page in the navigational
flow chart - 4 ANALYSIS OBJECT MODEL
- 5 ANALYSIS FUNCTIONAL MODEL
- 5.1 USE CASES (a list of the use cases)
- 5.2 PSEUDOCODE
- 6 DATA DICTIONARY
40OMT Process Steps
Learning Goal 2 Developing an OODB
- Conceptualization
- Business analysts or users conceive of an
application and list requirements - Analysis
- Real-world models are constructed
- Specify what to do, not how to do it
- System Design
- Develop the high-level architecture
41Step 3, System Design
Learning Goal 2 Developing an OODB
oodb server
personal computer
HTTP
Web Server
ObjectStore Application Packages
(e.g., the WebConnect CGI program and the
Template Processor)
Template Files
.DLL
.OFT
.DB
42OMT Process Steps (Cont.)
Learning Goal 2 Developing an OODB
- Detailed Design
- Adjustments to simplify implementation and
improve execution
43Step 4, Detailed Design
Learning Goal 2 Developing an OODB
- Simplify the object model
44Database Designer
Learning Goal 2 Developing an OODB
Step 4, Detailed Design
- GUI-based ObjectStore program
- Used to draw the Detailed Design object model
- Saves the database schema in a .dbs file
45Database Designer
Learning Goal 2 Developing an OODB
Step 4, Detailed Design
- Create the classes and save as gradebook.dbs
46Database Designer
Learning Goal 2 Developing an OODB
Step 4, Detailed Design
- Create the classes and save as gradebook.dbs
47Database Designer
Learning Goal 2 Developing an OODB
Step 4, Detailed Design
- Create the classes and save as gradebook.dbs
48OMT Process Steps (Cont.)
Learning Goal 2 Developing an OODB
- Detailed Design
- Adjustments to simplify implementation and
improve execution - Implementation
- Translate the design into code
49Step 5, Implementation
Learning Goal 2 Developing an OODB
- ObjectStore tools for implementation
- Visual C Wizards (e.g., Component Wizard)
- Inspector
- Publisher
- Mini Server
- MS Visual C
- Run the ObjectStore Wizards
- Write the methods from the functional model
- Write the callback functions for adding,
deleting, and editing items in the database
50Component Wizard
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Automatically writes code for all classes created
by Database Designer - Including get and set methods
- Inserts TODO comments as placeholders for
recommended modifications - Creates main( ), which can be modified to create
and populate the OODB file - When these files are compiled the DLL is created
51Component Wizard
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Begin by starting MS Visual C
- In the File menu, select New
- In Projects, select ObjectStore Component Wizard
52Component Wizard
Learning Goal 2 Developing an OODB
Step 5, Implementation
- In the Wizard, open the gradebook.dbs created by
Database Designer
53Component Wizard
Learning Goal 2 Developing an OODB
Step 5, Implementation
- After clicking Finish, a complete ObjectStore
project will be created, including these files - Weight.h, Weight.cpp, Person.h, and Person.cpp
- Attributes
- Constructors
- set and get methods
- gradebook.defDLL definition file
- gradebook.dspDLL project file
- gradebook.dswworkspace file
- schema.scmschema definition used by automatic
processes - A Console project will also be created,
including - main.cpp will create the database file when
executed
54Visual C
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Write the special methods
- Any methods other than routine set and get
methods - Methods that are specified in the functional
model - Example Setting the course grade
55Visual C
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Create the DLLCompile the ObjectStore project
(gradebook) that has the Person and Weight
classes - Create the gradebook.db file to hold the database
- In the Console project (gradebook_console),
modify main.cpp
- Compile and execute the Console project
56Visual C
Learning Goal 2 Developing an OODB
Step 5, Implementation
- If desired, additional code can be added to
main.cpp to populate the gradebook.db file with
some objects
Weight aNewWeight
new(db,Weight_type) Weight(25, 25, 15, 15, 20,
"2002fa5433") WeightColl-gtinsert(aNewWeight)
os_collection WeightColl
(os_collection)WeightRoot-gtget_value() if(!Weig
htColl) WeightColl os_collectioncreate(db
) WeightRoot-gtset_value(WeightColl)
os_database_root WeightRoot
db-gtfind_root("Weight_root") if(!WeightRoot)
WeightRoot db-gtcreate_root("Weight_root")
- Recompile and execute the Console project
57Visual C
Learning Goal 2 Developing an OODB
Step 5, Implementation
- To update the database content dynamically within
the Web application - The developer must write the C code that will
make updates - Callback functions
- addItem.cpp
- deleteItem.cpp
- editItem.cpp
- Added to the DLL when compiled
- ObjectForms AppWizard generates a skeleton C
source file that can be modified
58Visual C Callbacks
Learning Goal 2 Developing an OODB
Step 5, Implementation
- In the File menu, select New
- In Projects, select ObjectForms AppWizard
59Visual C Callbacks
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Select Publisher callback DLL
- Enter 3 because we need three callback
functions (for adding, deleting, and editing) - Use meaningful names (e.g., addItem, deleteItem)
60Visual C Callbacks
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Edit the skeleton callbacks in Visual C
os_database theDB SyncOpenWriteDB(dbName,
b_wasOpenMVCC) bError (theDB
NULL) if(!bError) TIX_HANDLE(err_objectstore)
OS_BEGIN_TXN(AddItem_txn, 0,
os_transactionupdate) /
TODO Add
transaction code
/ OS_END_TXN(AddItem_tx
n) TIX_EXCEPTION bErrorTRUE /
TODO Add exception handling code
/ TIX_END_HANDLE SyncCloseWriteDB(theD
B, b_wasOpenMVCC)
61Visual C Callbacks
Learning Goal 2 Developing an OODB
Step 5, Implementation
// TODO Add transaction code //Get the person
root and the person collection os_database_root
PersonRoot theDB-gtfind_root("Person_root") if(
! PersonRoot) bError TRUE sprintf(errorStr,
"ltpgtError looking for root.lt/pgt") else
os_collection PersonColl (os_collection)
PersonRoot-gtget_value() if( ! PersonColl )
bError TRUE sprintf(errorStr,"ltpgtError
looking for root value.lt/pgt") else
//Create a new student from the data Person
newPerson new(theDB,Person_type)
Person(courseid,studentid,lname,fname,mname,admin,
coursegrade,midterm,final,presentati
on,groupproject, individualproject,
coursescore,midtermaverage, finalaver
age,presenterid,atoi(baddtoroot)) //Insert the
new person into the collection PersonColl-gtinser
t(newPerson)
62OFT Templates
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Create the Web pages
- HTML with special ObjectForms tags
- Server-side code that generates HTML
- Used to publish OODB data on a Web page
- Created by ObjectForms Publisher
- OFT files can be modified
- Any text editor
- Add formatting to change the page appearance
- Refine the code by adding ObjectForms tags
63Publisher
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Uses gradebook.db to publish data on the Web page
- Creates the .oft template files in the Publish
Wizard
64OFT Templates
Learning Goal 2 Developing an OODB
Step 5, Implementation
ltinclude "Headers\GradeBookHeader.html"gt ltosdat
abaseC\gradebook\gradebook_console\gradebook.db
"gt ltQUERY NAME"query1" OSFUNCTION"osiquery"gt
ltif query1.Status EQ 0gt ltTABLE BORDER0
CELLPADDING7 CELLSPACING0 width"745"gt lt!--
table title and headers go here --gt ltBEGINDETAIL
NAME"query1"gt ltTRgt ltTD ALIGN"left"
BGCOLORFFFFFFgtltCourseIDgtlt/TDgt ltTD
ALIGN"center" BGCOLORFFFFFFgtltMidTermWeightgt
lt/TDgt ltTD ALIGN"center" BGCOLORFFFFFFgtltFinal
Weightgt lt/TDgt ltTD ALIGN"center"
BGCOLORFFFFFFgtltPresentationWeightgt
lt/TDgt ltTD ALIGN"center" BGCOLORFFFFFFgtltGroup
ProjectWeightgt lt/TDgt ltTD ALIGN"center"
BGCOLORFFFFFFgtltIndividualProjectWeightgt
lt/TDgt lt/TRgt ltENDDETAILgt lt/TABLEgt ltelsegt ltqu
ery1.ErrorMsggtltpgt ltendifgt lt/bodygtlt/htmlgt
65OFT Templates
Learning Goal 2 Developing an OODB
Step 5, Implementation
66Local Testing
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Publisher Runtime Service
- An ObjectForms service that provides the callback
functions - Set the configuration by adding gradebook.DLL
- Start the serviceruns in a separate console
window - Start the MiniServer
- An ObjectStore HTTP server
- Listens on port 8484 by default
- Start your browser, and enter the URL for the
opening page of the Online Grade Book - http//129.7.166.738484/Grades_submit.html
67Implementation Steps
Learning Goal 2 Developing an OODB
Step 5, Implementation
4. Test with the MiniServer, then make any
necessary revisions.
68Completed Project
Learning Goal 2 Developing an OODB
Step 5, Implementation
- The student ID is used to retrieve the grades
69Completed Project
Learning Goal 2 Developing an OODB
Step 5, Implementation
- By clicking on Administrator Login, the teacher
can go the admin login page
70Completed Project
Learning Goal 2 Developing an OODB
Step 5, Implementation
- Clicking on Add A New Student lets the teacher
enter student data, which is added after clicking
Add
Add
71Completed Project
Learning Goal 2 Developing an OODB
Step 5, Implementation
- By clicking on View Grade Weights, the teacher
can view the weight for calculating the course
score
Weights.oft
72Step 5, Implementation
Learning Goal 2 Developing an OODB
- Project Report
- 1 SPECIAL FEATURES
- A list of any unique features
- 2 LESSONS LEARNED
- Problems and solutions
- 3 USER NAMES AND PASSWORDS FOR TESTING
- 4 USER GUIDE
- 5 FLOW CHART
- The final design of the navigational flow chart
- 6 CODE FOR TEMPLATES AND C CALLBACK FUNCTIONS
- 7 STEPS FOR DEVELOPING AND DEPLOYING
- 8 DIARY
73Conclusion
- Students were able to learn OO analysis and
design with real-world tools - Students were also able to implement an OO
database and use it with a Web application that
they developed
74 Thank You
Any questions?