Comp 204 Final Project Fall 2002 - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Comp 204 Final Project Fall 2002

Description:

Variables for voters, candidates and admins. Issues. Pattern has to allow undoable operations ... Stores voter, candidate & admin states to Database. Issues ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 19
Provided by: bradh2
Category:

less

Transcript and Presenter's Notes

Title: Comp 204 Final Project Fall 2002


1
Comp 204 Final ProjectFall 2002
  • Brad E. Hinson
  • Alicia L. Wright

2
Class Database
  • Responsibilities
  • Data storage
  • Stores election results
  • Login information
  • Variables for voters, candidates and admins
  • Issues
  • Pattern has to allow undoable operations
  • Should externalize data in case of system failure

3
Class Database
Singleton
memento
Database
Memento
Caretaker
static getDatabase( )
return uniqueDatabase
GetState( )
setMemento(Memento m)
SetState( )
createMemento( )
uniqueDatabase
state
Memento
return new Memento(state)
state m ? GetState( )
4
Class Security
  • Responsibilities
  • Prevents unauthorized access to the system
  • Talks to the database to provide secure login
  • Issues
  • Do we need one Security object per user?

5
Class Security
Singleton
Security
Database
static getSecurity( )
return uniqueDatabase
uniqueSecurity
6
Class Election
  • Responsibilities
  • Holds variables pertaining to a particular
    election
  • Issues
  • Can we just use a single election flyweight?
  • Allows admin to access and edit election variables

7
Class Election
Visitor
Client
visitElection( )
Election
Accept(Visitor)
Visitor
Vote A
Vote B
Accept(Visitor)
Accept(Visitor)
v ? visitVoteB(this)
8
Class DocumentHandler
  • Responsibilities
  • Handles document creation and deletion
  • Allows user to view document
  • Issues
  • Should handle multiple languages (Interpreter?)
  • One handler per user or one per document?

9
Class DocumentHandler
Factory
DocumentHandler
loadDocument( )
displayDocument( )
EnglishHandler
SpanishHandler
ChineseHandler
DocHandlerCreator
FactoryMethod( )
return new DocumentHandler
10
Class Session
  • Responsibilities
  • Acts as interface for logged in users
  • Stores voter, candidate admin states to
    Database
  • Issues
  • Can we just use a single session flyweight?
  • Election objects must be notified of new votes
  • Should be able to grab data from the Database
  • Session type determined at user login

11
Class Session
Session
Mediator
Elections
Mediator
Candidate Session
Voter Session
Admin Session
SessionCreator
realSubject
Proxy
Database
FactoryMethod( )
return uniqueDatabase
Request( )
Request( )
Factory
Proxy
Database ? Request( )
12
Class StatAnalysis
  • Responsibilities
  • Prepares reports from stored data
  • Generates StatReport objects (later)
  • Issues
  • Able to step through elections collecting data
  • Command vs. Strategy for actual computation

13
Class StatAnalysis
Strategy
Elections
createIterator( )
Election Iterator
StatAnalysis
Iterator
Strategy
First( )
AlgorithmInterface( )
Next( )
isDone( )
Current( )
Computation A
Computation B
Iterator
AlgorithmInterface( )
AlgorithmInterface( )
14
Class StatReport
  • Responsibilities
  • Stores and displays results from StatAnalysis
  • Issues
  • Created by StatAnalysis
  • Should execute various commands (e.g. print, plot)

15
Class StatReport
Command
StatAnalysis
StatReport
Command
Execute( )
Client
receiver
PrintCommand
PlotCommand
SaveCommand
Execute( )
Execute( )
Execute( )
Receiver
receiver ? Action( )
Action( )
16
Class UserInterface
  • Responsibilities
  • Acts as the graphical user interface for a
    session
  • Issues
  • Alters itself based on current user permissions
  • Should provide a single interface for inner
    workings

17
Class UserInterface
Facade
UserInterface
Draw( )
Elections
Sessions

Security
Database

component
EmptyScreen
Decorator
component ? Draw( )
Draw( )
Draw( )
Decorator
Option
Choice
Button
Draw( )
Draw( )
Draw( )
18
QUESTIONS?
Happy Holidays!
Write a Comment
User Comments (0)
About PowerShow.com