summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-02-10 20:22:23 -0500
committernfoy <nfoy@purdue.edu>2014-02-10 20:22:23 -0500
commit7391c3098729d83ae944e03fc4ee1eb315254cdb (patch)
tree556e1ea7ff0ddee6dfc2a09215ab377aad734265
parentdd9213d9d02e8b2e5eb834d4a72abd9aea0470de (diff)
parente93332a7352f7f21c84ecdde874041535fe91e3b (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
-rw-r--r--docs/DesignDocument-classes.dot232
-rw-r--r--docs/DesignDocument.md20
2 files changed, 201 insertions, 51 deletions
diff --git a/docs/DesignDocument-classes.dot b/docs/DesignDocument-classes.dot
index 000256d..eed00d3 100644
--- a/docs/DesignDocument-classes.dot
+++ b/docs/DesignDocument-classes.dot
@@ -1,88 +1,213 @@
digraph systemModel {
rankdir="LR";
- splines="line";
+ splines="ortho";
subgraph _clusterModels {
label="Models"
node[shape="record"];
-
+
BaseModel[label="<main> ActiveRecord::Base (abstract)"]
+
+ Server[label="<main> Server"];
+ Tournament[label="<main> Tournament"];
+ Match[label="<main> Match"];
+ Team[label="<main> Team"];
User[label="<main> User | <attr_role> role | <attr_pw> password hash"];
}
-
- subgraph _clusterControllers {
- label="Controllers";
- node[shape="record"];
-
- ApplicationController[label="<main> ApplicationController (abstract)"];
-
- MainController[label="<main> MainController | <index> show_homepage() | <edit> edit_settings() | <update> update_settings()"];
- TournamentsController[label="<main> TournamentsController | <index> index() | <new> new() | <create> create() | <show> show() | <edit> edit() | <update> update() | <end> end()"];
- MessagesController[label="<main> MessagesController"];
- LoginController[label="<main> LoginController | <login> login() | <logout> logout()"];
- SearchController[label="<main> SearchController"];
- UsersController[label="<main> UsersController"];
- MatchesController[label="<main> MatchesController"];
- }
subgraph _clusterViews {
label="views/";
node[shape="rectangle"]
- layouts_application[label="layouts/application.html (abstract)"]
-
+ layouts_application[label="layouts_application (abstract)"]
subgraph clusterViewsCommon {
label="views/common/";
common_permission_denied;
common_invalid;
}
-
subgraph clusterViewsMain {
label="views/main/";
main_homepage;
main_edit;
}
+ search_results;
+ subgraph clusterViewsMessages {
+ label="views/messages/";
+ messages_new_alert;
+ messages_private;
+ }
subgraph clusterViewsTournament {
label="views/tournament/";
tournaments_index;
- tournaments_new;
tournaments_show;
+ tournaments_new;
tournaments_edit;
}
- subgraph clusterViewsMessages {
- label="views/messages/";
- messages_private;
- messages_new_alert;
+ subgraph clusterViewsMatches {
+ label="views/matches/";
+ matches_show;
+ matches_edit;
+ }
+ subgraph clusterViewsTeams {
+ label="views/teams/";
+ teams_index;
+ teams_show;
+ teams_new;
+ teams_edit;
+ }
+ subgraph clusterViewsUsers {
+ label="views/users/";
+ users_index;
+ users_new;
+ users_show;
+ users_edit;
}
}
+ subgraph _clusterControllers {
+ label="Controllers";
+ node[shape="record"];
+
+ ApplicationController[label="<main> ApplicationController (abstract)"];
+
+ MainController[label="<main> MainController | <index> show_homepage() | <edit> edit_settings() | <update> update_settings()"];
+ LoginController[label="<main> LoginController | <login> login() | <logout> logout()"];
+ SearchController[label="<main> SearchController | <show_results> show_results()"];
+ MessagesController[label="<main> MessagesController | <new_alert> new_alert() | <post_alert> post_alert() | <show_private> show_private() | <post_private> post_private()"];
+ TournamentsController[label="<main> TournamentsController | <index> index() | <new> new() | <create> create() | <show> show() | <edit> edit() | <update> update() | <end> end()"];
+ MatchesController[label="<main> MatchesController | <index> index() | <show> show() | <edit> edit() | <update> update()"];
+ TeamsController[label="<main> TeamsController | <index> index() | <show> show() | <new> new() | <create> create() | <edit> edit() | <update> update()"]
+ UsersController[label="<main> UsersController | <index> index() | <show> show() | <new> new() | <create> create() | <edit> edit() | <update> update() | <delete> delete()"]
+ }
+
+ /*
subgraph inheritance {
- edge[arrowhead="onormal"];
- MainController:main -> ApplicationController;
+ # Kludge: Have a arrow going both ways, but one invisible, so
+ # that it doesn't try to force a position
+
+ # models
+
+ Server:main -> BaseModel[arrowhead=onormal];
+ BaseModel -> Server:main[style=invis];
+
+ Tournament:main -> BaseModel[arrowhead=onormal];
+ BaseModel -> Tournament:main[style=invis];
+
+ Match:main -> BaseModel[arrowhead=onormal];
+ BaseModel -> Match:main[style=invis];
+
+ Team:main -> BaseModel[arrowhead=onormal];
+ BaseModel -> Team:main[style=invis];
+
+ User:main -> BaseModel[arrowhead=onormal];
+ BaseModel -> User:main[style=invis];
+
+ # views
+
+ common_permission_denied -> layouts_application[arrowhead=onormal];
+ layouts_application -> common_permission_denied[style=invis];
+
+ common_invalid -> layouts_application[arrowhead=onormal];
+ layouts_application -> common_invalid[style=invis];
+
+ main_homepage -> layouts_application[arrowhead=onormal];
+ layouts_application -> main_homepage[style=invis];
+
+ main_edit -> layouts_application[arrowhead=onormal];
+ layouts_application -> main_edit[style=invis];
+
+ messages_new_alert -> layouts_application[arrowhead=onormal];
+ layouts_application -> messages_new_alert[style=invis];
+
+ messages_private -> layouts_application[arrowhead=onormal];
+ layouts_application -> messages_private[style=invis];
+
+ tournaments_index -> layouts_application[arrowhead=onormal];
+ layouts_application -> tournaments_index[style=invis];
+
+ tournaments_show -> layouts_application[arrowhead=onormal];
+ layouts_application -> tournaments_show[style=invis];
+
+ tournaments_new -> layouts_application[arrowhead=onormal];
+ layouts_application -> tournaments_new[style=invis];
+
+ tournaments_edit -> layouts_application[arrowhead=onormal];
+ layouts_application -> tournaments_edit[style=invis];
+
+ matches_show -> layouts_application[arrowhead=onormal];
+ layouts_application -> matches_show[style=invis];
+
+ matches_edit -> layouts_application[arrowhead=onormal];
+ layouts_application -> matches_edit[style=invis];
+
+ teams_index -> layouts_application[arrowhead=onormal];
+ layouts_application -> teams_index[style=invis];
+
+ teams_show -> layouts_application[arrowhead=onormal];
+ layouts_application -> teams_show[style=invis];
+
+ teams_new -> layouts_application[arrowhead=onormal];
+ layouts_application -> teams_new[style=invis];
+
+ teams_edit -> layouts_application[arrowhead=onormal];
+ layouts_application -> teams_edit[style=invis];
+
+ users_index -> layouts_application[arrowhead=onormal];
+ layouts_application -> users_index[style=invis];
+
+ users_new -> layouts_application[arrowhead=onormal];
+ layouts_application -> users_new[style=invis];
+
+ users_show -> layouts_application[arrowhead=onormal];
+ layouts_application -> users_show[style=invis];
+
+ users_edit -> layouts_application[arrowhead=onormal];
+ layouts_application -> users_edit[style=invis];
+
+ # controllers
+
+ MainController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> MainController:main[style=invis];
- TournamentsController:main -> ApplicationController;
+
+ TournamentsController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> TournamentsController:main[style=invis];
- MessagesController:main -> ApplicationController;
+
+ MessagesController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> MessagesController:main[style=invis];
- LoginController:main -> ApplicationController;
+
+ LoginController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> LoginController:main[style=invis];
- SearchController:main -> ApplicationController;
+
+ SearchController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> SearchController:main[style=invis];
- UsersController:main -> ApplicationController;
+
+ UsersController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> UsersController:main[style=invis];
- MatchesController:main -> ApplicationController;
+
+ MatchesController:main -> ApplicationController[arrowhead="onormal"];
ApplicationController -> MatchesController:main[style=invis];
}
+ */
subgraph controller2view {
- layouts_application -> LoginController:login;
- layouts_application -> LoginController:logout;
-
MainController:index -> main_homepage;
MainController:edit -> main_edit -> MainController:update;
- MainController:edit -> common_permission_denied;
+ #MainController:edit -> common_permission_denied;
MainController:update -> main_edit;
- MainController:update -> common_permission_denied;
+ #MainController:update -> common_permission_denied;
+
+ #LoginController:login -> common_permission_denied;
+ #LoginController:logout -> common_invalid;
+
+ SearchController:show_results -> search_results;
+
+ MessagesController:new_alert -> messages_new_alert -> MessagesController:post_alert;
+ MessagesController:show_private -> messages_private;
+ MessagesController:post_private -> messages_private;
+ #MessagesController:new_alert -> commmon_permission_denied;
+ #MessagesController:post_alert -> commmon_permission_denied;
+ #Messagescontroller:show_private -> common_permission_denied;
+ #Messagescontroller:post_private -> common_permission_denied;
TournamentsController:index -> tournaments_index;
TournamentsController:new -> tournaments_new -> TournamentsController:create;
@@ -90,13 +215,32 @@ digraph systemModel {
TournamentsController:show -> tournaments_show;
TournamentsController:edit -> tournaments_edit -> TournamentsController:update;
TournamentsController:update -> tournaments_edit
- TournamentsController:edit -> common_permission_denied;
- TournamentsController:end -> common_permission_denied;
+ #TournamentsController:new -> common_permission_denied;
+ #TournamentsController:create -> common_permission_denied;
+ #TournamentsController:edit -> common_permission_denied;
+ #TournamentsController:update -> common_permission_denied;
+ #TournamentsController:end -> common_permission_denied;
+
+ MatchesController:show -> matches_show;
+ MatchesController:edit -> matches_edit -> MatchesController:update;
+ #MatchesController:edit -> common_permission_denied;
+ #MatchesController:update -> common_permission_denied;
- MessagesController -> messages_private;
- MessagesController -> messages_new_alert;
+ TeamsController:index -> teams_index;
+ TeamsController:show -> teams_show;
+ TeamsController:new -> teams_new -> TeamsController:create;
+ TeamsController:create -> teams_edit;
+ TeamsController:edit -> teams_edit -> TeamsController_update;
+ #TeamsController:new -> common_permission_denied;
+ #TeamsController:create -> common_permission_denied;
+ #TeamsController:edit -> common_permission_denied;
+ #TeamsController:update -> common_permission_denied;
- LoginController:login -> common_permission_denied;
- LoginController:logout -> common_invalid;
+ UsersController:index -> users_index;
+ UsersController:new -> users_new -> UsersController:create;
+ UsersController:edit -> users_edit -> UsersController:delete;
+ UsersController:show -> users_show;
+ UsersController:edit -> users_edit -> UsersController:update
+ # TODO: permission_denied
}
}
diff --git a/docs/DesignDocument.md b/docs/DesignDocument.md
index b647de4..0f0087c 100644
--- a/docs/DesignDocument.md
+++ b/docs/DesignDocument.md
@@ -29,6 +29,7 @@ sleek web application which manages tournaments.
1. Security: - Because Project Leaguer servers may store sensitive user information like name, email, statistics, user-name, profile, etc. it is an important non-functional requirement that such data is well secured from both accidental exposure and intentional tampering. Even so, the System may not be responsible for the theft of user information or even alterations made to the database from a source different from that of Leaguer.
2. Backup: - The Leaguer system provides a user with a database of user information and is updated and stored, which is functional. In contrast, the non-functional requirement of leaguer is its ability to back up all the information of the user when the user chooses to suspend or delete record or even when the user happens to disconnect from the server.
3. Platform Compatibility: - A non-functional requirement for the system is to be able to run on multiple platforms. Primarily a web based application, Leaguer may not be able to install into embedded gaming devices and special operation systems that do not run the interface that Leaguer was initially built on.
+4. Response Time: - Even though the "Model 2" architecture tends to scale well for medium/large applications and data sets, it is still important to keep the response time of the system in mind. Using efficient data structures, short time complexity algorithms, and minimizing network overhead whenever possible will help to keep the response time of the system reasonable even for large data sets or complex statists or scoring schemes.
# Design Outlines
@@ -127,15 +128,14 @@ Tournement
: This model represents the structure of a tournement. It will have several data sections to it including: The match settings, the matches contained inside of the tournement, a unique id for the tournement, and the registered players that are participating in the tournement.
Match
- : A match will be a single set of data that contains all of the statistics of one game. This includes: players, scores, game time, the tournement that match took place in, and the date.
+ : A match will be a single set of data that contains all of the statistics of one game. This includes: players personal scores, team members, scores for each team, game time, the tournement that match took place in, and the date.
Team
- : This model will consist of a list of players for a tournement/game. The team creation process is chosen by the host of the tournement and will either be pre-determined teams, or randomly assigned teams.
+ : This model will consist of a list of players for a tournement. The team creation process is chosen by the host of the tournement and team setup will either be pre-determined teams or randomly assigned teams.
User
: This model represents all types of users; hosts, players, and
spectators. These roles are identified by a “role” attribute.
- TODO
### VIEWS
@@ -217,6 +217,9 @@ tournaments/edit.html
: A form for editing an existing tournament. The form is POSTed to
`TournamentsController#update()`.
+matches/index.html
+ : TODO: list of matches
+
matches/show.html
: Shows an individual match; q display of both teams. Each team's
players are clickable which causes a GET for the player's profile
@@ -292,13 +295,15 @@ LoginController
model to validate the username and password.
- `logout()` Responds to POST requests by clearing the session
token, logging the user out, then redirects to the home page
- (`MainController#show_homepage()`). If the was not logged in,
+ (`MainController#show_homepage()`). If the user was not logged in,
it renders the `common/invalid` view.
SearchController
- : TODO
+ : This controller handles user search terms. It has one method:
- - `show_results()` TODO: RESPONDS TO POST
+ - `show_results()` Responds to POST by accessing whichever model(s)
+ contains the information requested and renders the `search/results`
+ view.
MessagesController
: TODO
@@ -336,6 +341,7 @@ TournamentsController
MatchesController
: TODO
+ - `index()`: TODO: GET
- `show()` TODO: GET
- `edit()` TODO: GET
- `update()` TODO: POST
@@ -354,9 +360,9 @@ UsersController
: TODO
- `index()` TODO: GET
+ - `show()` TODO: GET
- `new()` TODO: GET
- `create()` TODO: POST
- - `show()` TODO: GET
- `edit()` TODO: GET
- `update()` TODO: POST
- `delete()` TODO: POST