title carolina first steering committee october 9, 2010 online voting system design yinpeng li and...

36
Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Upload: peter-atkinson

Post on 05-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

TitleCarolina First Steering CommitteeOctober 9, 2010

Online Voting System Design

Yinpeng Li and Tian CaoMay 3, 2011

Page 2: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Outline

System Description System Logic Explanations User Stories Use Case Diagram

System Design System Architecture Design Pattern

Discussion

Page 3: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

System Logic Explanations

Inside of the system, a Voter is not allowed to participate in any election until he/she has registered as an Electorate. An Election officer is in charge of system maintenance, voter registration approval, election creation, etc.

An election can be at different levels and be of different topics. It can either be a voting of political referendums, or a voting of candidates for a government position. Depending on the type of an election, the Ballot can contain different kind of options.

Page 4: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

User Stories

Four Roles Voter Electorate Candidate Election Officer

Page 5: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Use Case Diagram

Page 7: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

System Architecture

The system is designed to comply with the MVC (Model–View–Controller) architecture.

Page 8: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

System Architecture

Both Server and Client have their own Model, View and Controller.

In Server-Side, the View generates a representation of a interface. This representation is downloaded to the Client which displays it. The Controller on the Server interprets the information from Client and routes the request to the View, which update the interface. The Model on the Server manages the database system.

In Client-Side, the View renders the interface to the screen, and the Controller interprets the keyboard and mouse events. The Model on Client deals with the data received from Server.

Page 10: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Design Patterns

Composite Factory Method Decorator Flyweight Observer Proxy Command Iterator and Strategy Memento Facade and Singleton State

Page 11: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Composite Pattern

The Composite pattern is used at the client side to organize the elements on the interface. In the system, all the information display and all the inputs are done through forms, which are similar to the concept in Web that's under the same name. A form can contain both data output elements such as Image Displays and Text Displays and data input elements such as Radios, Checkboxes and Text Inputs. The forms can be saved on the server for future continuation or be submitted directly.

Page 12: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Composite Pattern

Page 13: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Factory Method Pattern

The Factory Method pattern is used at the client side to defer the instantiation of Client to its subclasses.

Page 14: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Factory Method Pattern

Page 15: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Decorator Pattern

The Decorator pattern is used at the client side to control the appearances of the Interface Elements.

Page 16: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Decorator Pattern

Page 17: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Flyweight Pattern

The Flyweight pattern is used at the server side to reduce repetitive data storage. The options in ballots are stored as objects on the server, and they are organized as flyweights in the system. Some of the registration info of the voters, such as the zip codes, are also stored as flyweights.

Page 18: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Flyweight Pattern

Page 19: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Observer Pattern

The Observer pattern is implemented over the client-server connection to perform real-time update of election results.

Page 20: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Observer Pattern

Page 21: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Proxy Pattern

The Proxy pattern is used at the client side. It controls the access to the server, and implements security mechanisms such as connection timeouts.

Page 22: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Proxy Pattern

Page 23: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Command Pattern

The Command pattern is used both at the client side and at the server side. It encapsulate the requests and responds in the system, and let the system queue or log them. It also supports undoable operations.

Page 24: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Command Pattern

Page 25: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Iterator and Strategy Patterns

The Iterator and Strategy patterns are applied in the vote tally logic components. The Strategy pattern is used to encapsulate different statistical algorithms for election result computation. The Iterator pattern is used to encapsulate different methods to iterate over the BallotList.

Page 26: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Iterator and Strategy Patterns

Page 27: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Memento Pattern

The Memento pattern is implemented to realize the "save for later" functionality. When an electorate clicks the "save for later" button on the form, the form (ballot) he/she is working on will create a memento and save it on the server. This way, the form can be restored later. The client side can also take advantage of this feature to implement a mechanism to deal with power-outage problems.

Page 28: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Memento Pattern

Page 29: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Facade and Singleton Patterns

The Facade pattern provides a interface to a set of database interfaces in a database subsystem. Facade defines a higher-level interface that makes the database subsystem easier to use for the server. The Singleton pattern is used to ensure the Database Interface only has one instance.

Page 30: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Facade and Singleton Patterns

Page 31: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

State Pattern

The State pattern is applied in the system to implement different command processing strategy for the client depending on the identity of the client. The identity is regarded as the state of the client.

Page 32: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

State Pattern

Page 33: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Discussion

Although the system is designed to comply with the MVC architecture, since the View and the Controller at the client side share the same visual components, these two parts and their logics are not separated explicitly during the design process.

Page 34: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Discussion

We used Command pattern to do server-client communication, instead of using Interpreter pattern, as is the case in real-world Web system. This is due to the fact that the Command pattern gives more flexibility when processing the commands. For example, with the Command pattern, commands can be queued before processed, which is hard for the Interpreter pattern to realize.

Page 35: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Discussion

The Flyweight pattern could also be used on the ballots submitted by the electorates to reduce storage cost. For example, for a ballot consists of 10 items, with each item featuring 4 options, there are a total of 410=1048576 possible submitted ballots. However, if the election is intended for all the people in the U.S., there could be more than 100 million votes in total, and using this simple enumeration will dramatically improve the storage efficiency.

Page 36: Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011

Section divider hereThank you for your attention.