CSC/ECE 517 Fall 2014/oss E1463 vpd
E1463: Refactoring TreeDisplayController
Project Links
Our Expertiza Fork on AWS
Github Repo
Project Running on AWS
Admin Account:
Username: user2
Password: password
Project Description
For this project, our team refactored the TreeDisplayController class in the Expertiza OSS project. This class provides access to questionnaires, review rubrics, author feedback, courses, assignments, and course evaluations. The tree display lists all of these categories with the ability for the user to "drill down" into the subcategories or just expand/collapse as needed.
Example Image Of Tree Display:
Refactoring TreeDisplayController Tasks
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-
- Changing List to Index using a RESTful approach.
- Use of routing helpers
- Use {} and [] instead of Hash.new and Array.new
- Ensuring that instantiation of instance variables is minimized.
Changing List to Index
All our code changes can be checked out at our Git project repository. It can be seen that we have replaced all the controller action redirections with a tree_display_index_path which enormously reduces the code content and as well as provides an organized approach to action redirections.
[[File:List to Index.png]
combined all of the goto methods
Use Routing Helpers
We refactored the treedisplay controller class to use route helpers rather than calling ":action => 'list', :controller => 'tree_display'", or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our Github repo shows all the changes made.
Example -- Route helpers added to breadcrumbs view file: