CSC/ECE 517 Fall 2013/oss ans: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
* There were “custom_create” and “custom_update” methods for “custom” (multipart) rubrics. We already had create and update methods that were handling the normal rubrics. Our job was to use polymorphism in order to eliminate the custom methods.
* There were “custom_create” and “custom_update” methods for “custom” (multipart) rubrics. We already had create and update methods that were handling the normal rubrics. Our job was to use polymorphism in order to eliminate the custom methods.


== Design Choices ==
== Refactoring carried out ==
As per the project requirements the following work was carried out :
As per the project requirements the following work was carried out :


Line 17: Line 17:




=== Refactoring carried out ===
== Testing Done ==
 
=== Testing Done ===


==Future Work ==
==Future Work ==


== Appendix ==
== Appendix ==

Revision as of 03:05, 30 October 2013

E807 : Refactoring and testing response_controller.rb


Introduction

The response controller creates, edits, and displays responses, that is, rubrics to be filled out, or filled-out rubrics. Our project requirement entailed the following things to be done.

  • Reduce the method complexity in the response controller
  • Remove duplicated code
  • There were “custom_create” and “custom_update” methods for “custom” (multipart) rubrics. We already had create and update methods that were handling the normal rubrics. Our job was to use polymorphism in order to eliminate the custom methods.

Refactoring carried out

As per the project requirements the following work was carried out :

  • The duplicated code has been refactored and put in a separate method which is called wherever required. This prevents redundancy.
  • The variables set up in controller become automatically available to the views. Hence the repeated code from controller and view for finding the topic id signed up by a user/team has been deleted from controller and incorporated only in the response view.
  • The custom create and custom update methods have been removed. Their functionality has been merged with create and update methods as was mentioned in the requirement specification. Depending on the type of rubric rendered, the create and update method does the necessary updations.


Testing Done

Future Work

Appendix