CSC/ECE 517 Spring 2015/oss E1509 lds: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 36: Line 36:
* Rename the controller(s) to SignupController and/or SignupSheetController.  (“Sign up”, which gets written as SignUp in camel case, is a verb, whereas “Signup” is a noun.)
* Rename the controller(s) to SignupController and/or SignupSheetController.  (“Sign up”, which gets written as SignUp in camel case, is a verb, whereas “Signup” is a noun.)
== Modification We Made ==
== Modification We Made ==
=== Removing unused controller ===
=== RESTful style implementation ===
=== Moving inappropriate functionality from controller to model ===
=== Breaking down long methods ===
=== Deleting redundant button ===
=== Renaming controller ===
=== Following global rules ===
== References ==
== References ==
<references/>
<references/>

Revision as of 19:22, 21 March 2015

E1509. Refactoring SignUpController and SignUpSheetController

This page talks about an open source project based on Expertiza. As a part of contribution to Expertiza, this project aims to refactor SignUpController and SignUpSheetControllers.

Introduction to Expertiza

Expertiza is a web application developed by Ruby on Rails framework. It serves as a peer review system for professors and students at NC State and some other colleges and universities. Students can submit different assignments and peer-review reusable learning objects (articles, code, web sites, etc)<ref>https://github.com/expertiza/expertiza</ref>. The Expertiza project is supported by the National Science Foundation. And it is an open source application and the source code can be cloned on Github .


Problem Statement

Classes involved

* sign_up_sheet.rb 
* sign_up_topic.rb 
* assignments_controller.rb
* response.rb
* and possibly other model classes

What it does

Lists topics available for an assignment, checks whether a user is signed up for a topic, allows users to sign up for topics.

What's wrong with it

  • These two controllers seem to do almost the same thing. They have many of the same methods. SignUpSheetController is much longer, and has many more recent mods, but some methods of SignUpController seem more sophisticated than SignUpSheetController. So, your first job is to figure out if both controllers are being used. If not, remove the unused controller. Or, move the functions to a single controller if that makes sense to do.
  • Neither controller is at all RESTful; i.e.., its method names aren’t the standard names new, create, edit, delete, etc. Functionality is divided differently than in a standard controller.
   a. def confirm_topic(creator_id, topic_id, assignment_id)
b. def delete_signup
c. def delete_signup_for_topic(assignment_id,topic_id)
d. def other_confirmed_topic_for_user(assignment_id, creator_id)
e. def signup
f. def slotAvailable?(topic_id)
  • Functionality that should be in models is incorporated into the controller.
  • Some methods are too long and appear to do more than one thing
  • This class interfaces with assignments_controller so that a list of topics can be displayed when one is editing an assignment. Please be careful that your changes do not affect the functionality on the Topics tab of editing an assignment.
  • Rename the controller(s) to SignupController and/or SignupSheetController. (“Sign up”, which gets written as SignUp in camel case, is a verb, whereas “Signup” is a noun.)

Modification We Made

Removing unused controller

RESTful style implementation

Moving inappropriate functionality from controller to model

Breaking down long methods

Deleting redundant button

Renaming controller

Following global rules

References

<references/>