CS 4773 Object Oriented Systems Assignment 5 Design
Main Classes
- Assign5Main:
- Contains main method
- Handles command line parameters
- Creates a user interface for initiating a vote
- Creates a user interface for displaying information about clients
- Saves data structures needed by multiple classes
- Collection of active votes (implements VoteLister)
- Collection of active connections (implements ConnectionLister)
- Creates the server
- Server:
- Creates initial socket
- Creates a new thread object to handle each connection
- Connection: extends Thread
- Handles a single connection
- Send vote request
- Send vote result
- Receive vote from client
- Handle errors
- Vote:
- Handles all information about a single vote
- Has a vote type
- Has a collection of active clients
For each client needs to know:
- Client name
- Connection object (null if no longer connected)
- Has it voted and what is the vote
- A user interface for:
- Sending results to all clients
- Closing the vote
- Displaying results