<?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=Jptaylor</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=Jptaylor"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jptaylor"/>
	<updated>2026-06-25T23:39:30Z</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_2009/wiki_1a_7a_SJ&amp;diff=19799</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19799"/>
		<updated>2009-09-18T23:31:46Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provides Ruby examples for each refactorings in this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || Y&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Development Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Ruby_Refactoring_Tools_in_Eclipse [2.1]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Java_Refactoring_Tools_in_Eclipse [2.2]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19798</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19798"/>
		<updated>2009-09-18T23:31:16Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provides Ruby examples for each refactorings in this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Development Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Ruby_Refactoring_Tools_in_Eclipse [2.1]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Java_Refactoring_Tools_in_Eclipse [2.2]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19715</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19715"/>
		<updated>2009-09-17T19:02:10Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provides Ruby examples for each refactorings in this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Ruby_Refactoring_Tools_in_Eclipse [2.1]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Java_Refactoring_Tools_in_Eclipse [2.2]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19714</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19714"/>
		<updated>2009-09-17T19:01:46Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provides Ruby examples for each refactorings in this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ#Example_of_Using_Ruby_Refactoring_Tools_in_Eclipse [2.1]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Java_Example_of_Refactoring [2.2]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19713</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19713"/>
		<updated>2009-09-17T19:01:14Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provides Ruby examples for each refactorings in this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Ruby_Example_of_Refactoring [2.1]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Java_Example_of_Refactoring [2.2]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19712</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19712"/>
		<updated>2009-09-17T19:00:05Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* List of Common Refactorings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provides Ruby examples for each refactorings in this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Ruby_Example_of_Refactoring [1.3]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Java_Example_of_Refactoring [1.4]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19559</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 7a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_7a_SJ&amp;diff=19559"/>
		<updated>2009-09-17T00:29:41Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Ruby_Example_of_Refactoring [1.3]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Java_Example_of_Refactoring [1.4]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19530</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19530"/>
		<updated>2009-09-16T23:22:09Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Ruby_Example_of_Refactoring [1.3]], [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Java_Example_of_Refactoring [1.4]]) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19529</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19529"/>
		<updated>2009-09-16T23:21:29Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section [http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ#Ruby_Example_of_Refactoring [1.3]], 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19527</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19527"/>
		<updated>2009-09-16T23:19:37Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension or can be inherited.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19526</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19526"/>
		<updated>2009-09-16T23:18:35Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes can be inherited or are open to extension.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19524</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19524"/>
		<updated>2009-09-16T23:16:53Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Type_system#Dynamic_typing dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19522</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19522"/>
		<updated>2009-09-16T23:16:16Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension.  On the other hand, Java is a [http://en.wikipedia.org/wiki/Type_system#Static_typing statically typed language], polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19521</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19521"/>
		<updated>2009-09-16T23:11:00Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via [http://en.wikipedia.org/wiki/Interface_%28computer_science%29 interfaces] and [http://en.wikipedia.org/wiki/Implementation_inheritance inheritance], and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19520</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19520"/>
		<updated>2009-09-16T23:09:39Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment(IDE) Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamically typed language], has unbounded [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism], and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19519</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19519"/>
		<updated>2009-09-16T23:08:14Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ease of Use and Integrated Develop Environment Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment(IDE) Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19518</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19518"/>
		<updated>2009-09-16T23:07:52Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Java Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|A getter(reader) and setter(writer) mehtod is selected and named.]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19516</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19516"/>
		<updated>2009-09-16T23:05:12Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Ruby Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19515</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19515"/>
		<updated>2009-09-16T23:04:48Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Java Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation is shown.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19513</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19513"/>
		<updated>2009-09-16T23:04:22Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Java Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation is shown.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and a preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19512</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19512"/>
		<updated>2009-09-16T23:04:00Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Java Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation is shown.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|The badly named method is called.]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot; as shown and a preview is selected.]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.  The call is shown here.]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19509</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19509"/>
		<updated>2009-09-16T23:00:59Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Java Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation is shown.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19507</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19507"/>
		<updated>2009-09-16T23:00:15Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Ruby Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring is shown with newly renamed method.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|The field to be encapsulated is shown inside its class.]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|The field is highlighted and then right clicked on.  Refactor then Encapsulate Field is selected.]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|A reader and writer method is selected to be generated and labeled private.]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|A preview of the encapsulation is shown.]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|The resulting code after refactoring is shown with encapsulated field.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19502</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19502"/>
		<updated>2009-09-16T22:56:01Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Ruby Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|The method is highlighted and then right clicked on.  Refactor then Rename is selected.]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|The method is renamed to &amp;quot;hello&amp;quot;]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|A preview of each call to the method is shown.]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|The resulting code after refactoring.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19497</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19497"/>
		<updated>2009-09-16T22:52:41Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Example of Using Ruby Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= The badly named method &amp;quot;badRenameMethod is shown with a call to this method.]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19490</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19490"/>
		<updated>2009-09-16T22:44:32Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* What is Code Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Refactoring tools for Ruby and Ruby on Rails.'''&lt;br /&gt;
&lt;br /&gt;
== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19485</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19485"/>
		<updated>2009-09-16T22:39:08Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Java Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19484</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19484"/>
		<updated>2009-09-16T22:38:50Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Java Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19483</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19483"/>
		<updated>2009-09-16T22:38:34Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Java Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19482</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19482"/>
		<updated>2009-09-16T22:38:10Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Java Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19481</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19481"/>
		<updated>2009-09-16T22:37:43Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19480</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19480"/>
		<updated>2009-09-16T22:36:57Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19479</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19479"/>
		<updated>2009-09-16T22:36:34Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19478</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19478"/>
		<updated>2009-09-16T22:36:07Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19477</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19477"/>
		<updated>2009-09-16T22:35:38Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19475</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19475"/>
		<updated>2009-09-16T22:35:10Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19473</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19473"/>
		<updated>2009-09-16T22:34:50Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
&lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19471</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19471"/>
		<updated>2009-09-16T22:33:57Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19470</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19470"/>
		<updated>2009-09-16T22:33:26Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19468</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19468"/>
		<updated>2009-09-16T22:32:41Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19467</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19467"/>
		<updated>2009-09-16T22:32:20Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19466</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19466"/>
		<updated>2009-09-16T22:31:52Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
*Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19462</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19462"/>
		<updated>2009-09-16T22:30:23Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19461</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19461"/>
		<updated>2009-09-16T22:30:14Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19460</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19460"/>
		<updated>2009-09-16T22:29:45Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19459</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19459"/>
		<updated>2009-09-16T22:29:09Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo] || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19457</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19457"/>
		<updated>2009-09-16T22:28:50Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo]        || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19456</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19456"/>
		<updated>2009-09-16T22:28:03Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo]  ||      N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] ||      N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] ||      N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] ||      N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] ||      N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] ||      N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] ||      Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) ||      Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19453</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19453"/>
		<updated>2009-09-16T22:27:12Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo]  || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org/ NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_editor.php Arachno Ruby] ||  N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://freeride.rubyforge.org/wiki/wiki.pl FreeRIDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.mondrian-ide.com/ Mondrian Ruby IDE] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.sapphiresteel.com/ Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.eclipse.org/ Eclipse] ([http://aptana.com/ Aptana]) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19447</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a 9b SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19447"/>
		<updated>2009-09-16T22:24:13Z</updated>

		<summary type="html">&lt;p&gt;Jptaylor: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: [5], refactoring is the process of applying behavior-preserving transformations to a program with the objective of improving the program’s design. Intuitively people refer to code refactoring as &amp;quot;cleaning it up.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Motivation of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Refactoring is very useful for software engineer to maintain the quality of their code in different environment. In fact, no software can be guaranteed to be perfect when it is first developed. Usually when the source code is applied to different customer needs, we want to improve the inner-structure without modify the external behavior. The ability to refactor your code takes the pressure off the design phase of software development. Refactoring gives you the ability to change the design of the code at a later stage. This means that you don’t have to get the design absolutely right before you write any code. You can get a rough design worked out, code it up and then if (when) you spot a better design you can refactor your code towards the better design.&lt;br /&gt;
&lt;br /&gt;
=== List of Common Refactorings ===&lt;br /&gt;
&lt;br /&gt;
In the following we list some popular refactoring to specify how refactoring transform the code. For more detail information, the reader please refer to the section 2.1.2 of the thesis of Thomas Corbat [1]. [1] provide Ruby example for each refactoring this list.   &lt;br /&gt;
  &lt;br /&gt;
{|&lt;br /&gt;
| 1. Merge Class Parts &lt;br /&gt;
|-&lt;br /&gt;
|	2. Convert Local Variable to Field &lt;br /&gt;
|-&lt;br /&gt;
|	3. Encapsulate Field &lt;br /&gt;
|-&lt;br /&gt;
|	4. Extract Method &lt;br /&gt;
|-&lt;br /&gt;
|	5. Inline Class &lt;br /&gt;
|-&lt;br /&gt;
|	6. Inline Method &lt;br /&gt;
|-&lt;br /&gt;
|	7. Move Field &lt;br /&gt;
|-&lt;br /&gt;
|	8. Move Method &lt;br /&gt;
|-&lt;br /&gt;
|	9. Rename Class &lt;br /&gt;
|-&lt;br /&gt;
|	10. Rename Field &lt;br /&gt;
|-&lt;br /&gt;
|	11. Rename Local Variable &lt;br /&gt;
|-&lt;br /&gt;
|	12. Rename Method &lt;br /&gt;
|-&lt;br /&gt;
|	13. Replace Temporary Variable with Query &lt;br /&gt;
|-&lt;br /&gt;
|	14. Split Temporary Variable &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ruby Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
class SomeClass&lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class SomeClass                &lt;br /&gt;
    def initialize&lt;br /&gt;
        @field = 0;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    def field&lt;br /&gt;
        @field&lt;br /&gt;
    end&lt;br /&gt;
    private :field&lt;br /&gt;
    &lt;br /&gt;
    def field= field&lt;br /&gt;
        @field = field&lt;br /&gt;
    end&lt;br /&gt;
    private :field=&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
Before Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void badRenameMethod()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Rename:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class rename_method&lt;br /&gt;
{&lt;br /&gt;
    static void hello()&lt;br /&gt;
    {&lt;br /&gt;
        System.out.println(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    public String field;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Encapsulation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class encap_field&lt;br /&gt;
{&lt;br /&gt;
    private int field;&lt;br /&gt;
&lt;br /&gt;
    public void setField(int field)&lt;br /&gt;
    {&lt;br /&gt;
        this.field = field;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public int getField()&lt;br /&gt;
    {&lt;br /&gt;
        return field;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&lt;br /&gt;
&lt;br /&gt;
This the following table we summary the current ruby IDE and their refactoring support situation. &lt;br /&gt;
{| &lt;br /&gt;
 | Current Ruby IDE || Refactoring Support (Y/N)&lt;br /&gt;
|-&lt;br /&gt;
 | [http://www.activestate.com/komodo/ ActiveState Komodo]  || N&lt;br /&gt;
 |- &lt;br /&gt;
 | NetBeans || N&lt;br /&gt;
 |-&lt;br /&gt;
 | Arachno Ruby ||  N&lt;br /&gt;
|-&lt;br /&gt;
 | FreeRIDE || N&lt;br /&gt;
|-&lt;br /&gt;
 | Mondrian Ruby IDE || N&lt;br /&gt;
|-&lt;br /&gt;
 | Ruby in Steel || N&lt;br /&gt;
|-&lt;br /&gt;
 | RubyMine || Y&lt;br /&gt;
|-&lt;br /&gt;
 | Eclipse (Aptana) || Y  &lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Ruby Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Ruby.  The source code is shown in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Ruby.  The source code is show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step 5]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of Using Java Refactoring Tools in Eclipse ===&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod&amp;quot; to &amp;quot;Hello&amp;quot; is illustrated for Java. The source code is show in section 1.4. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step 1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step 2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step 3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step 4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step 5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step 6]]&lt;br /&gt;
|}&lt;br /&gt;
Here the encapsulation of the field &amp;quot;field&amp;quot; is illustrated for Java. The source code is show in section 1.4.&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step 1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step 2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step 3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step 4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java Refactoring Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Comprehensiveness ===&lt;br /&gt;
&lt;br /&gt;
These are the following refactoring options available in eclipse for Ruby and Java.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Refactoring Options for Java in Eclipse'''  ||||  '''Refactoring Options for Ruby in Eclipse'''&lt;br /&gt;
|-&lt;br /&gt;
|Rename   || || Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move || || Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature || || Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable || || Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant || || Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Inline || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested || || Split Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level || || Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field || || Inline&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class || || Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface || || Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class || || Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Use Supertype where possible&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up &lt;br /&gt;
|-&lt;br /&gt;
|Pull Down &lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter Object&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Indirection&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Factory&lt;br /&gt;
|-&lt;br /&gt;
|Introduce Parameter&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Generalize Declared Type&lt;br /&gt;
|-&lt;br /&gt;
|Infer Generic Type Arguments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ease of Use and Integrated Develop Environment Integration ===&lt;br /&gt;
&lt;br /&gt;
The refactoring options for Ruby and Java cover all the basic refactorings.  The differences in the number of options mainly come from the difference in the two languages. Ruby is a dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is a statically typed language, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at run-time.  The given examples (in section 1.3, 1.4) illustrate the ease of use of the refactoring tools for both Ruby and Java and how well these tools are integrated into the Eclipse IDE.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker Refactoring Support for the Eclipse Ruby Development Tools, Diploma Thesis, HSR University of Applied Sciences Rapperswil Institute for Software.&lt;br /&gt;
&lt;br /&gt;
[2] Code Refactoring Wiki, http://en.wikipedia.org/wiki/Code_refactoring.&lt;br /&gt;
&lt;br /&gt;
[3] The First Workshop on Refactoring, https://netfiles.uiuc.edu/dig/RefactoringWorkshop&lt;br /&gt;
&lt;br /&gt;
[4] Refactoring Tutorial for Ruby on Rails, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;br /&gt;
&lt;br /&gt;
[5] Martin Fowler Refactoring: Improving the Design of Existing Code&lt;/div&gt;</summary>
		<author><name>Jptaylor</name></author>
	</entry>
</feed>