<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sfernan2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sfernan2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sfernan2"/>
	<updated>2026-05-15T09:58:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91510</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91510"/>
		<updated>2014-11-06T04:43:06Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Setup - How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&amp;lt;br&amp;gt;&lt;br /&gt;
'''User:''' user2&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Combined all of the goto methods&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==1) Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==2) Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==3) Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0'' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==4) Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following was added to the ''index'' function of '''tree_display_controller.rb''' in order to replace the use of instance variables with local variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
locals  search:       @search,&lt;br /&gt;
        sortvar:      @sortvar,&lt;br /&gt;
        sortorder:    @sortorder,&lt;br /&gt;
        root_node:    @root_node,&lt;br /&gt;
        child_nodes:  @child_nodes,&lt;br /&gt;
        filternode:   params[:filternode],&lt;br /&gt;
        searchnode:   params[:searchnode]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many of the view files were changed to make use of the local variables. &lt;br /&gt;
&lt;br /&gt;
Here is an example of how _bread_crumbs.html.erb was changed. Note the removal of the &amp;quot;@&amp;quot; characters.&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = @root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= @root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
 end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, ensured that instantiation of instance variables is minimized, and overall improved the quality and efficiency of the Expertiza codebase.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91509</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91509"/>
		<updated>2014-11-06T04:41:47Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Refactoring TreeDisplayController Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Setup - How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&amp;lt;br&amp;gt;&lt;br /&gt;
'''User:''' user2&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Combined all of the goto methods&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==1) Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==2) Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==3) Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0'' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==4) Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following was added to the ''index'' function of '''tree_display_controller.rb''' in order to replace the use of instance variables with local variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
locals  search:       @search,&lt;br /&gt;
        sortvar:      @sortvar,&lt;br /&gt;
        sortorder:    @sortorder,&lt;br /&gt;
        root_node:    @root_node,&lt;br /&gt;
        child_nodes:  @child_nodes,&lt;br /&gt;
        filternode:   params[:filternode],&lt;br /&gt;
        searchnode:   params[:searchnode]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many of the view files were changed to make use of the local variables. &lt;br /&gt;
&lt;br /&gt;
Here is an example of how _bread_crumbs.html.erb was changed. Note the removal of the &amp;quot;@&amp;quot; characters.&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = @root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= @root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
 end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91508</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91508"/>
		<updated>2014-11-06T04:40:20Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Setup - How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&amp;lt;br&amp;gt;&lt;br /&gt;
'''User:''' user2&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0'' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following was added to the ''index'' function of '''tree_display_controller.rb''' in order to replace the use of instance variables with local variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
locals  search:       @search,&lt;br /&gt;
        sortvar:      @sortvar,&lt;br /&gt;
        sortorder:    @sortorder,&lt;br /&gt;
        root_node:    @root_node,&lt;br /&gt;
        child_nodes:  @child_nodes,&lt;br /&gt;
        filternode:   params[:filternode],&lt;br /&gt;
        searchnode:   params[:searchnode]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many of the view files were changed to make use of the local variables. &lt;br /&gt;
&lt;br /&gt;
Here is an example of how _bread_crumbs.html.erb was changed. Note the removal of the &amp;quot;@&amp;quot; characters.&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = @root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= @root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
 end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91507</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91507"/>
		<updated>2014-11-06T04:40:03Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&amp;lt;br&amp;gt;&lt;br /&gt;
'''User:''' user2&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0'' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following was added to the ''index'' function of '''tree_display_controller.rb''' in order to replace the use of instance variables with local variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
locals  search:       @search,&lt;br /&gt;
        sortvar:      @sortvar,&lt;br /&gt;
        sortorder:    @sortorder,&lt;br /&gt;
        root_node:    @root_node,&lt;br /&gt;
        child_nodes:  @child_nodes,&lt;br /&gt;
        filternode:   params[:filternode],&lt;br /&gt;
        searchnode:   params[:searchnode]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many of the view files were changed to make use of the local variables. &lt;br /&gt;
&lt;br /&gt;
Here is an example of how _bread_crumbs.html.erb was changed. Note the removal of the &amp;quot;@&amp;quot; characters.&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = @root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= @root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if root_node %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to &amp;quot;Return to top&amp;quot;, tree_display_index_path %&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      curr_node = root_node&lt;br /&gt;
   while curr_node.parent_id&lt;br /&gt;
     curr_node = Node.find(curr_node.parent_id) %&amp;gt;&lt;br /&gt;
   &amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
   &amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= root_node.get_name %&amp;gt;&amp;lt;%&lt;br /&gt;
 end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91455</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91455"/>
		<updated>2014-11-05T22:52:36Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Use Routing Helpers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&amp;lt;br&amp;gt;&lt;br /&gt;
'''User:''' user2&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0'' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91454</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91454"/>
		<updated>2014-11-05T22:50:06Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* How To View Our Expertiza Fork Running on AWS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&amp;lt;br&amp;gt;&lt;br /&gt;
'''User:''' user2&amp;lt;br&amp;gt;&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91453</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91453"/>
		<updated>2014-11-05T22:47:58Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91452</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91452"/>
		<updated>2014-11-05T22:47:47Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Use Routing Helpers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91451</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91451"/>
		<updated>2014-11-05T22:47:20Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Refactoring TreeDisplayController Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include:&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91450</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91450"/>
		<updated>2014-11-05T22:46:35Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* How To View Our Expertiza Fork Running on AWS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ our Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91449</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91449"/>
		<updated>2014-11-05T22:46:12Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* How To View Our Expertiza Fork Running on AWS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Expertiza project running on AWS]&lt;br /&gt;
&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91448</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91448"/>
		<updated>2014-11-05T22:45:48Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Project Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Expertiza project running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91447</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91447"/>
		<updated>2014-11-05T22:45:40Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=How To View Our Expertiza Fork Running on AWS=&lt;br /&gt;
NOTE: The scope of our project was only to refactor select code. There are no feature additions or changes, so it should work just like production Expertiza.&lt;br /&gt;
&lt;br /&gt;
1) Go to [http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Expertiza project running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
2) Login as Admin&lt;br /&gt;
'''User:''' user2&lt;br /&gt;
'''Password:''' password&lt;br /&gt;
&lt;br /&gt;
3) Click on &amp;quot;Manage...&amp;quot; if you are not automatically directed to the tree display.&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91446</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91446"/>
		<updated>2014-11-05T22:41:24Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Changing List to Index */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91445</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91445"/>
		<updated>2014-11-05T22:40:46Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91444</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91444"/>
		<updated>2014-11-05T22:40:13Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91443</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91443"/>
		<updated>2014-11-05T22:40:02Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 very similar methods we removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91442</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91442"/>
		<updated>2014-11-05T22:39:42Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
Shown below are 3 of the 10 unnecessary methods we removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91441</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91441"/>
		<updated>2014-11-05T22:39:11Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Use Routing Helpers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the tree display controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''' changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of routing helpers in '''_bread_crumbs.html.erb'''. &amp;lt;br&amp;gt;&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'drill', :root =&amp;gt; curr_node.id %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= link_to curr_node.get_name, tree_display_index_path(root: curr_node.id)%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91440</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91440"/>
		<updated>2014-11-05T22:34:59Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Use Routing Helpers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb'''changes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91439</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91439"/>
		<updated>2014-11-05T22:34:37Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91438</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91438"/>
		<updated>2014-11-05T22:34:20Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Changing List to Index */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to '''remove''' list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91437</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91437"/>
		<updated>2014-11-05T22:33:59Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to remove list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
'''Added''' variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Removed''' goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Added''' index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91436</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91436"/>
		<updated>2014-11-05T21:00:26Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to remove list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use {} and [] instead of Hash.new and Array.new==&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91435</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91435"/>
		<updated>2014-11-05T20:56:51Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to remove list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In conclusion, we were able to successfully refactor the tree_display_controller and related controllers and views. We improved and expanded the use of RESTful and DRY design choices, implemented the use of routing helpers, used {} and [] instead of Hash.new and Array.new, and ensured that instantiation of instance variables is minimized.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91434</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91434"/>
		<updated>2014-11-05T20:53:29Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to remove list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from '''tree_display_controller.rb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91433</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91433"/>
		<updated>2014-11-05T20:53:11Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Use Routing Helpers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to remove list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
As seen below, we utilized routing helpers and replaced '' ':controller=&amp;gt;'course', :action=&amp;gt;'new' '' with ''new_course_path(private: 0)''.&lt;br /&gt;
&lt;br /&gt;
'''_courses_folder_actions.html.erb''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
   &amp;lt;div&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-public-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 0 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 0), &lt;br /&gt;
  + { title: 'Create Public Course', id: 'create-public-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;%= link_to image_tag('/assets/tree_view/add-private-24.png'), &lt;br /&gt;
  - { :controller=&amp;gt;'course', :action=&amp;gt;'new', :private =&amp;gt; 1 }, &lt;br /&gt;
  - { :title =&amp;gt; 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
  + new_course_path(private: 1), &lt;br /&gt;
  + { title: 'Create Private Course', id: 'create-private-course' } %&amp;gt; &lt;br /&gt;
   &amp;lt;/div&amp;gt; &lt;br /&gt;
   &amp;lt;/ul&amp;gt; &lt;br /&gt;
   &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91432</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91432"/>
		<updated>2014-11-05T20:47:23Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
In order to make the codebase more [http://www.restapitutorial.com/lessons/whatisrest.html RESTful], 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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
As seen below, we were able to remove list from the Routes.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
resources :tree_display do &lt;br /&gt;
collection do &lt;br /&gt;
  get ':action' &lt;br /&gt;
    - post 'list' &lt;br /&gt;
  end &lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91431</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91431"/>
		<updated>2014-11-05T20:41:53Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91430</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91430"/>
		<updated>2014-11-05T20:40:57Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Refactoring TreeDisplayController Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of [http://guides.rubyonrails.org/routing.html#path-and-url-helpers routing helpers]&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91429</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91429"/>
		<updated>2014-11-05T20:35:11Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Changing List to Index */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of routing helpers&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91428</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91428"/>
		<updated>2014-11-05T20:34:23Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of routing helpers&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
All our code changes can be checked out at our [https://github.com/Druotic/expertiza/pull/1/files Git project repository]. &lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91427</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91427"/>
		<updated>2014-11-05T20:34:01Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Combined All of the Goto Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of routing helpers&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
All our code changes can be checked out at our [https://github.com/Druotic/expertiza/pull/1/files Git project repository]. &lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The goto_assignments method was replaced with an index method to accept this variable, rather then calling each goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Added index method:&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91426</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91426"/>
		<updated>2014-11-05T20:33:24Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of routing helpers&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
All our code changes can be checked out at our [https://github.com/Druotic/expertiza/pull/1/files Git project repository]. &lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The index method was modified to accept this variable, rather then calling each &lt;br /&gt;
goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Added index method:&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91425</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91425"/>
		<updated>2014-11-05T20:32:42Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of routing helpers&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
All our code changes can be checked out at our [https://github.com/Druotic/expertiza/pull/1/files Git project repository]. &lt;br /&gt;
&lt;br /&gt;
==Combined All of the Goto Methods==&lt;br /&gt;
We also combined all of the goto methods into one, in accordance with the [http://en.wikipedia.org/wiki/Don't_repeat_yourself DRY] principle. This removed a significant amount of duplicate code.&lt;br /&gt;
&lt;br /&gt;
3 of the 10 unnecessary methods removed from tree_display_controller.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- # direct access to questionnaires &lt;br /&gt;
- def goto_questionnaires &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Questionnaires') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to review rubrics &lt;br /&gt;
- def goto_review_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Review') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
- &lt;br /&gt;
- # direct access to metareview rubrics &lt;br /&gt;
- def goto_metareview_rubrics &lt;br /&gt;
- node_object = TreeFolder.find_by_name('Metareview') &lt;br /&gt;
- session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
- redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These methods were replaced by a variable containing a list mapping of all the session variable strings to database labels. The index method was modified to accept this variable, rather then calling each &lt;br /&gt;
goto method individually.&lt;br /&gt;
&lt;br /&gt;
Added variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ @@Groups = { &lt;br /&gt;
+   'Questionnaires' =&amp;gt; 'Questionnaires', &lt;br /&gt;
+   'Review rubrics' =&amp;gt; 'Review', &lt;br /&gt;
+   'Metareview rubrics' =&amp;gt; 'Metareview', &lt;br /&gt;
+   'Teammate review rubrics' =&amp;gt; 'Teammate Review', &lt;br /&gt;
+   'Author feedbacks' =&amp;gt; 'Author Feedback', &lt;br /&gt;
+   'Global survey' =&amp;gt; 'Global Survey', &lt;br /&gt;
+   'Surveys' =&amp;gt; 'Survey', &lt;br /&gt;
+   'Course evaluations' =&amp;gt; 'Course Evaluation', &lt;br /&gt;
+   'Courses' =&amp;gt; 'Courses', &lt;br /&gt;
+   'Bookmarkrating' =&amp;gt; 'Bookmarkrating', &lt;br /&gt;
+   'Assignments' =&amp;gt; 'Assignments' &lt;br /&gt;
+ } &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removed goto_assignments method:&lt;br /&gt;
- # direct access to assignments &lt;br /&gt;
- def goto_assignments &lt;br /&gt;
-   node_object = TreeFolder.find_by_name('Assignments') &lt;br /&gt;
-   session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
-   redirect_to :controller =&amp;gt; 'tree_display', :action =&amp;gt; 'list' &lt;br /&gt;
- end &lt;br /&gt;
&lt;br /&gt;
Added index method:&lt;br /&gt;
+ def index &lt;br /&gt;
+   session[:root] = params[:root] &lt;br /&gt;
+   group = getGroup session[:menu] &lt;br /&gt;
+   node_object = TreeFolder.find_by_name(group) &lt;br /&gt;
+   if not group.blank? and not node_object.blank? &lt;br /&gt;
+     session[:root] = FolderNode.find_by_node_object_id(node_object.id).id &lt;br /&gt;
+ end &lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91424</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91424"/>
		<updated>2014-11-05T20:10:35Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/449 Expertize Pull Request] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account login details : &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
&lt;br /&gt;
As part of the refactoring task, we had to address the following issues for enhancing code readability and maintainability. The tasks include-&lt;br /&gt;
#Changing List to Index using a [http://www.restapitutorial.com/lessons/whatisrest.html RESTful] approach.&lt;br /&gt;
#Use of routing helpers&lt;br /&gt;
#Use {} and [] instead of Hash.new and Array.new&lt;br /&gt;
#Ensuring that instantiation of instance variables is minimized.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changing List to Index==&lt;br /&gt;
All our code changes can be checked out at our [https://github.com/Druotic/expertiza/pull/1/files Git project repository]. &lt;br /&gt;
&lt;br /&gt;
combined all of the goto methods&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs view file before:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to :action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
redirect_to direct_to tree_display_index_path&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:List_to_Index.png]]&lt;br /&gt;
&lt;br /&gt;
==Minimizing the count of Instance Variables==&lt;br /&gt;
=== Instance Variables in Ruby ===&lt;br /&gt;
An instance variable has a name beginning with @, and its scope is confined to whatever object self refers to. Two different objects, even if they belong to the same class, are allowed to have different values for their instance variables. From outside the object, instance variables cannot be altered or even observed (i.e., ruby's instance variables are never public) except by whatever methods are explicitly provided by the programmer. As with globals, instance variables have the nil value until they are initialized.&lt;br /&gt;
&lt;br /&gt;
Instance variables do not need to be declared. This indicates a flexible object structure; in fact, each instance variable is dynamically appended to an object when it is first assigned.&lt;br /&gt;
&lt;br /&gt;
We have observed that in Expertiza, there were several code files related to the Tree Display controller which were observed to be using multiple instance variables which could be reduced. Our team aimed to limit the instantiation of such variables to only necessary places in our code.&lt;br /&gt;
&lt;br /&gt;
==Other Methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91365</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91365"/>
		<updated>2014-11-01T00:39:47Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Project Running on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
Admin Account: &amp;lt;br&amp;gt;&lt;br /&gt;
Username: user2 &amp;lt;br&amp;gt;&lt;br /&gt;
Password: password&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Example -- Route helpers added to breadcrumbs view file:&lt;br /&gt;
[[File:routehelpers.PNG ]]&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91364</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91364"/>
		<updated>2014-10-31T22:55:29Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similar. This involved many edits in the tree_display_controller.rb file and related controller and view files. Our [https://github.com/Druotic/expertiza Github repo] shows all the changes made.&lt;br /&gt;
&lt;br /&gt;
Example -- Route helpers added to breadcrumbs view file:&lt;br /&gt;
[[File:routehelpers.PNG ]]&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91363</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91363"/>
		<updated>2014-10-31T22:52:46Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similiar.&lt;br /&gt;
&lt;br /&gt;
Route helpers added to breadcrumbs view file:&lt;br /&gt;
[[File:routehelpers.PNG ]]&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91362</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91362"/>
		<updated>2014-10-31T22:51:56Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display:&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
We refactored the treedisplay controller class to use route helpers rather than calling &amp;quot;:action =&amp;gt; 'list', :controller =&amp;gt; 'tree_display'&amp;quot;, or something similiar.&lt;br /&gt;
&lt;br /&gt;
Route helpers added to breadcrumbs view file:&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91361</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91361"/>
		<updated>2014-10-31T22:43:23Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
Route helpers added to breadcrumbs&lt;br /&gt;
[[File:Expertiza.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
Route helpers added to breadcrumbs&lt;br /&gt;
[[File:Routehelpers.PNG]]&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91360</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91360"/>
		<updated>2014-10-31T22:43:14Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
Route helpers added to breadcrumbs&lt;br /&gt;
[[File:Exp.PNG ]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==Use Routing Helpers==&lt;br /&gt;
Route helpers added to breadcrumbs&lt;br /&gt;
[[File:Routehelpers.PNG]]&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91359</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91359"/>
		<updated>2014-10-31T22:41:41Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
Route helpers added to breadcrumbs&lt;br /&gt;
[[File:Routehelpers.PNG]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==use routing helpers==&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91358</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91358"/>
		<updated>2014-10-31T22:41:10Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
Route helpers added to breadcrumbs&lt;br /&gt;
[[File:expertiza.PNG]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==use routing helpers==&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Routehelpers.PNG&amp;diff=91357</id>
		<title>File:Routehelpers.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Routehelpers.PNG&amp;diff=91357"/>
		<updated>2014-10-31T22:39:08Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91271</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91271"/>
		<updated>2014-10-30T03:26:33Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'''Example Image Of Tree Display&lt;br /&gt;
'''&lt;br /&gt;
[[File:expertiza.PNG]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==use routing helpers==&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91270</id>
		<title>CSC/ECE 517 Fall 2014/oss E1463 vpd</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_E1463_vpd&amp;diff=91270"/>
		<updated>2014-10-30T03:26:11Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''E1463: Refactoring TreeDisplayController''' =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Project Links=&lt;br /&gt;
[http://ec2-54-186-80-176.us-west-2.compute.amazonaws.com:3000/ Our Expertiza Fork on AWS]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/Druotic/expertiza Github Repo]&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
&lt;br /&gt;
For this project, our team refactored the TreeDisplayController class in the [http://expertiza.ncsu.edu/ 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 &amp;quot;drill down&amp;quot; into the subcategories or just expand/collapse as needed.&lt;br /&gt;
&lt;br /&gt;
'Example Image Of Tree Display'&lt;br /&gt;
[[File:expertiza.PNG]]&lt;br /&gt;
&lt;br /&gt;
=Refactoring TreeDisplayController Tasks=&lt;br /&gt;
==combined all of the goto methods==&lt;br /&gt;
&lt;br /&gt;
==use routing helpers==&lt;br /&gt;
&lt;br /&gt;
==only use 1 instance variable in list method==&lt;br /&gt;
&lt;br /&gt;
==look at the rest of the methods==&lt;br /&gt;
&lt;br /&gt;
=Summary and Conclusions=&lt;br /&gt;
=Future Work=&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza.PNG&amp;diff=91268</id>
		<title>File:Expertiza.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza.PNG&amp;diff=91268"/>
		<updated>2014-10-30T03:24:41Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: uploaded a new version of &amp;amp;quot;File:Expertiza.PNG&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;expertiza&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza.PNG&amp;diff=91260</id>
		<title>File:Expertiza.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Expertiza.PNG&amp;diff=91260"/>
		<updated>2014-10-30T03:21:07Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: expertiza&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;expertiza&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Exp.PNG&amp;diff=91248</id>
		<title>File:Exp.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Exp.PNG&amp;diff=91248"/>
		<updated>2014-10-30T03:15:23Z</updated>

		<summary type="html">&lt;p&gt;Sfernan2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sfernan2</name></author>
	</entry>
</feed>