Design Document

braintreesmileSoftware and s/w Development

Aug 15, 2012 (5 years and 1 month ago)

332 views






Red Devil



High Level
Design Document

TestGuru



4
/1
1
/11

CSc 30
9

Credits

High Level Design Document


Design Overview



Clark DuVall

High Level Design Document


Tools




Clark DuVall

High Level Design Document


Libraries




Clark DuVall

High Level

Design Document


UML Deployment Diagram

Clark DuVall

High Level Design Document


Class Skeletons



Clark DuVall

High Level Design Document


Interaction Diagrams


Clark DuVall

High Level Design Document


Design Rationale



Josh Worthington

High Level D
esign Document


Appendix




Clark DuVall

Javadocs



Writing and ideas






Clark DuVall

Javadocs


Ideas







Josh Worthington

Class Diagram








Clark DuVall

Architectural Design


Ideas






Josh Worthington

Architectural
Design


Writing and ideas




Clark DuVall

Revisions








Clark DuVall


For the javadocs and Architectural design, Josh and Clark jointly worked on one
computer. This is a luxury we have as students and we will try to break down large tasks
into individual components.
Project:

Tes
tGuru Design

Team:


Red Devil

Author:

Clark DuVall

and Josh Worthington

Date:


4
/1
1
/11

I.
Design Overview

We chose to use the Model
-
View
-
Controller architectural pattern. The Model and its
parts are found in the
ExamItems

package. The model that holds an E
xam item is the
Exam

class. The View part of the architecture is found in the
GUI

package, with the
Controller consisting of the various action listeners within the
GUI

classes. The four
main packages of the project are explained below.

A.
GUI Package

The
GUI

package has everything needed to display the NetBeans GUI and switch
between the different
Forms

for alternate question types. This package also handles
displaying the different views, such as Edit View and Document View.


The
TestGuruApp

class starts
the
MasterGUI
.


The
Console

class runs TestGuru from the command line without a GUI.


The
MasterGUI

class runs the main NetBeans GUI. All the other GUI classes are used
by this one to display different aspects of the main GUI.

This includes the Document
Vi
ew, Answer Sheet View, and Edit View.


The
Toolbar

class handles displaying the toolbar and all interactions with it.


The
Forms

interface is implemented by all the forms classes which are displayed by the
MasterGUI
.


All the
Form

classes are used by the
M
asterGUI

to display forms for the different
question and design item types.


The
Help

class is used to display the h
elp box.


B.
PersistanceUtils

Package

The
PersistanceUtils

package holds
the classes to save and load a test document,
as well as the class
used to randomize the test
.
This package has utilities that can be used
on any
Exam
.


The
Randomizer

class has methods that allow an
Exam

to be randomized in a variety
of ways.


The
Save
r

and
Load
er

classes allow the program to save and

load data in a spec
ific
format.

C.
Doc
Util
s Package

The
Doc
Util
s

package has classes for rendering pages of the document and printing
them.


The
Pages

class can render a page of the document or answer sheet to a
Graphics2D

surface.


The
Print
er

class handles printing of the
document received from the
Pages

class.

D.
ExamItem
s Package

The
ExamItems

package holds the individual question types and the formatting items.
The
Exam

class in the
ExamItems

package

holds a complete exam.


The
Exam

class holds a complete
Exam
, from the
questions and design items on the
exam to the formatting of the exam.


The
PrintableObjects

interface is implemented by all objects that can be printed
on a test.


The
Question

class holds generic question information and methods to get and change
this inf
ormation.


Each question type has a class that extends
Question

and holds the data that is unique
to that type of question.


The
NonQuestion

class holds generic data for all objects that can be printed on the test
but are not questions.


Each type of forma
tting item has a class that extends
NonQuestion

and holds the data
that is unique to that item.


The
TitleGroup

class holds information that will be at the top of

the first page of

each
test document.

II.
Tools

We used BlueJ 2.5.3 to format the Class Diagr
am and create most of the classes. We also
used NetBeans IDE 6.9.1 to edit code.

III.
Libraries

We used JDK 1.6 along with the Swing Application Framework for this project.

IV.
UML Deployment Diagram

TestGuru is a single desktop application deployed as a J
AR file, so no deployment
diagram is provided.

V.
Class Diagram

The class diagram for TestGuru can be found on the Red Devil wiki

under class diagram
on the schedule
.

VI.
Class Skeletons

The J
avadocs for all the classes can be found on the Red Devil wiki

u
nder Javadocs on
the schedule
.

VII.
Interaction Diagrams

It has not been necessary to create any interaction diagrams yet.

VIII.
Design Rationale

Issu
e 1

Should we create new classes to hold the GUI for Save/Load, should we have it in a
method in Save/Load
, or should we have it in
MasterGUI
?


Alternative A:

Separate Classes


Advantages:

The GUI code is even more separated from the logic and the code
will be broken down into more manageable classes.


Disadvantages:

We need to write more classes and are addin
g a new set of
complexity to the problem.


Alternative B:

Method


Advantages:

The GUI code will be carried around by the classes and can be used
as a default. There are fewer classes to write.


Disadvantages:

The GUI is more integrated into the logic and t
he Save/Load
classes will be larger.


Alternative C:

MasterGUI


Advantages:

MasterGUI

already has the imports, is automatically generated
code, simple and separates the GUI from logic.


Disadvantages:

All the GUI code is centralized in one large class.


De
cision:

We decided to go with Alternative C,
MasterGUI
. It is less complex then
Alternative A and Alternative B, is automatically generated for us, and we do not need to
worry about trying to link many classes together.


Issue 2

Should we create separate c
lasses for the
Forms

displayed by
MasterGUI

or have all
the code in
MasterGUI
?


Alternative A:

Separate Classes


Advantages:
The GUI code is separated into more manageable classes, without
interfering with the underlying logic and is easier to maintain lat
er.


Disadvantages:

There are more classes to write and a new layer of complexity to
the problem.


Alternative B:

MasterGUI


Advantages:
The GUI code is auto generated, has fewer classes and does not
need to link multiple classes.


Disadvantages:
The code
is centralized in a single large class and would be
difficult to add new
Forms

later on.


Decision:
We have decided to go with Alternative A. Creating separate classes allow us
to manage each
Form

individually without changing a large file. It also allows
for easily
adding new
Forms

for questions.

Issue 3

Should
PrintableObjects

be its own class or an interface?


Alternative A:
Class


Advantages:
The classes that use
PrintableObjects

will be able to use its
getType()

method.


Disadvantages:
The
DrawTest()

a
nd
DrawAnswer()

methods would need
to be fake and overridden in every lower class.


Alternative B:
Interface


Advantages:
We do not need to write methods
PrintableObjects

itself
won’t use. (ie.
PrintableObjects

will never use
DrawTest()
)


Disadvantages:

We

need to write the
getType()

method for all the bottom
classes.


Decision:
We have decided to go with Alternative B. Each
DrawTest()

method and
DrawAnswer()

method is different for the classes below
PrintableObjects
. The
advantage we would get from making
it a class is outweighed by the disadvantage of
implementing those me
t
hods.

Appendix

The appendix contains output from compiling the project. The QA checklist is attached to
the back of this document.

Output from Compile

init:

deps
-
clean:

Updating propert
y file: C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build
\
built
-
clean.properties

Deleting directory C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build

clean:

init:

deps
-
jar:

Created dir: C:
\
D
ocuments and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build

Updating property file: C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build
\
built
-
jar.properties

Created dir: C:
\
Documents and Settings
\
Clark
\
My
D
ocuments
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build
\
classes

Created dir: C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build
\
empty

Compiling 43 source files to C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
Te
stGuru
\
build
\
classes

Note: C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
src
\
GUI
\
SectTiForm.java uses
or overrides a deprecated API.

Note: Recompile with
-
Xlint:deprecation for details.

Copying 32 files to C:
\
Documents and Se
ttings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
build
\
classes

compile:

Created dir: C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
dist

Copy libraries to C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
dist
\
lib.

Building jar: C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
dist
\
TestGuru.jar

To run this application from the command line without Ant, try:

java
-
jar "C:
\
Documents and Settings
\
Clark
\
My
Documents
\
Ne
tBeansProjects
\
Trunk
\
TestGuru
\
dist
\
TestGuru.jar"

jar:

BUILD SUCCESSFUL (total time: 3 seconds)

Output from Javadoc

init:

Warning: Leaving out empty argument '
-
windowtitle'

Generating Javadoc

Javadoc execution

Loading source file C:/Documents and Settings/C
lark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/DocUtils/Pages.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/DocUtils/Printer.java...

Loading source file C:/Documents and Settings/Clark/M
y
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/DocumentOptions
.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/Exam.java...

Loading source file C:/Documents and Settings/Clar
k/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/FillInTheBlanks
.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/LongAnswer.java
...

Loading source file C:/Documents and Sett
ings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/Matching.java..
.

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/MultipleChoice.
java...

Loading source file C:/Documents an
d Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/NonQuestion.jav
a...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/PrintableObject
s.java...

Loading source file C:/D
ocuments and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/Question.java..
.

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/SectionTitle.ja
va...

Loading source file
C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/ShortAnswer.jav
a...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/TestEquals.java
...

Loading source
file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/TextBlock.java.
..

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/TitleGroup.java
...

Loading sour
ce file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/ExamItems/TrueOrFalse.jav
a...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/Console.java...

Loading source f
ile C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/DesignSelectionListen
er.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/DocumentViewPanel.jav
a...

Load
ing source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/FBForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/Forms.java...

Loading source file C
:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/Help.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/InstructionsUI.java..
.

Loading source file C:/Document
s and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/LAForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/MCForm.java...

Loading source file C:/Documents and Settings/C
lark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/MForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/MasterGUI.java...

Loading source file C:/Documents and Settings/Clark/My
Docume
nts/NetBeansProjects/Trunk/TestGuru/src/GUI/RandomizeUI.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/SAForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBean
sProjects/Trunk/TestGuru/src/GUI/SectTiForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/TFForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Tr
unk/TestGuru/src/GUI/TestGuruApp.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/TextBlForm.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/Tes
tGuru/src/GUI/Toolbar.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/GUI/fileChooser.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/
PersistanceUtils/ExamLoad
er.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/PersistanceUtils/ExamSave
r.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Tr
unk/TestGuru/src/PersistanceUtils/ExamSave
rLoader.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/PersistanceUtils/Loader.j
ava...

Loading source file C:/Documents and Settings/Clark/My
Documents/
NetBeansProjects/Trunk/TestGuru/src/PersistanceUtils/Randomiz
er.java...

Loading source file C:/Documents and Settings/Clark/My
Documents/NetBeansProjects/Trunk/TestGuru/src/PersistanceUtils/Saver.ja
va...

Constructing Javadoc information...

Standard Doclet
version 1.6.0_17

Building tree for all the packages and classes...

Building index for all the packages and classes...

Building index for all classes...

Generating C:
\
Documents and Settings
\
Clark
\
My
Documents
\
NetBeansProjects
\
Trunk
\
TestGuru
\
dist
\
javadoc
\
sty
lesheet.css..
.

Note: Custom tags that could override future standard tags: @post,
@pre. To avoid potential overrides, use at least one period character
(.) in custom tag names.

Browsing:
file:/C:/Documents%20and%20Settings/Clark/My%20Documents/NetBeansPro
jec
ts/Trunk/TestGuru/dist/javadoc/index.html

javadoc:

BUILD SUCCESSFUL (total time: 10 seconds)