<?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=Sheng+yi</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=Sheng+yi"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sheng_yi"/>
	<updated>2026-06-05T21:54:25Z</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_2_2_SJ&amp;diff=26382</id>
		<title>CSC/ECE 517 Fall 2009/wiki 2 2 SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_2_2_SJ&amp;diff=26382"/>
		<updated>2009-10-15T17:02:33Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
'''Refactoring If Statement with Polymorphism.'''&lt;br /&gt;
&lt;br /&gt;
== Design Consideration: Reuse and Change ==&lt;br /&gt;
&lt;br /&gt;
One of the most important consideration of Object-Orientation Software Design is 'Reuse' and 'Change' [2][4]. In terms of reuse, we mean to build the new software with the building block from the old software. The importance of 'change' is from the fact that the software is always changing to keep alive. So that how to effectively make change to the source code is critical for the software design.   &lt;br /&gt;
 &lt;br /&gt;
=== The Problem of If Statement ===&lt;br /&gt;
&lt;br /&gt;
Under the design consideration we have discussed, the problem of if statement is quite obvious: 1. the conditional relationship in function level prevent us to reuse each of the function separately. We can only reuse the whole application as a unit. 2. when we want to change the functionality of a certain function or add a new function we have to trace to every implementation code. Such change is expensive and violate the OO principle 'code to interface instead of implementation'.    &lt;br /&gt;
&lt;br /&gt;
=== Example of If statement ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class Operator&lt;br /&gt;
{&lt;br /&gt;
    string operation;&lt;br /&gt;
&lt;br /&gt;
    public int Execute(int x, int y)&lt;br /&gt;
    {&lt;br /&gt;
         switch(operation)&lt;br /&gt;
         {&lt;br /&gt;
             case &amp;quot;Add&amp;quot;:&lt;br /&gt;
                 return x + y;&lt;br /&gt;
             case &amp;quot;Subtract&amp;quot;:&lt;br /&gt;
                 return x - y;&lt;br /&gt;
             case &amp;quot;Multiply&amp;quot;:&lt;br /&gt;
                 return x * y;&lt;br /&gt;
             case &amp;quot;Divide&amp;quot;:&lt;br /&gt;
                 return x / y;&lt;br /&gt;
             default:&lt;br /&gt;
                 throw new InvalidOperationException(&amp;quot;Unsupported operation&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such example of conditional statement on operator, we see that: if we want to reuse function &amp;quot;add&amp;quot; operator in the other code segment, we have to reuse whole Class operator with the value &amp;quot;Add&amp;quot;. And if we want to add a new operation &amp;quot;Power&amp;quot;, we need to code in the implementation of Class Operator.&lt;br /&gt;
&lt;br /&gt;
== Idea of Polymorphism ==&lt;br /&gt;
Facing the problem of the conditional statement, people[2] come up with refactoring method called 'Polymorphism'. The idea of Polymorphism is to replace the highly functional relationship with the subclass override procedure under abstract class. So subclass is created to encapsulate each function in the conditional statement and the conditional relation is replaced by override a common abstract class. The advantage of such idea is to separate the functionality.    &lt;br /&gt;
&lt;br /&gt;
=== Definition of Polymorphism ===&lt;br /&gt;
According to [1], Subtype polymorphism, almost universally called just polymorphism in the context of object-oriented programming, is the ability of one type, A, to appear as and be used like another type, B. &lt;br /&gt;
&lt;br /&gt;
The primary usage of polymorphism in industry (object-oriented programming theory) is the ability of objects belonging to different types to respond to method, field, or property calls of the same name, each one according to an appropriate type-specific behavior. The programmer (and the program) does not have to know the exact type of the object in advance, and so the exact behavior is determined at run time.&lt;br /&gt;
&lt;br /&gt;
== Example of Refactoring Conditional Statement with Polymorphism ==&lt;br /&gt;
*Before refactoring&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class Operator&lt;br /&gt;
{&lt;br /&gt;
    string operation;&lt;br /&gt;
&lt;br /&gt;
    public int Execute(int x, int y)&lt;br /&gt;
    {&lt;br /&gt;
         switch(operation)&lt;br /&gt;
         {&lt;br /&gt;
             case &amp;quot;Add&amp;quot;:&lt;br /&gt;
                 return x + y;&lt;br /&gt;
             case &amp;quot;Subtract&amp;quot;:&lt;br /&gt;
                 return x - y;&lt;br /&gt;
             case &amp;quot;Multiply&amp;quot;:&lt;br /&gt;
                 return x * y;&lt;br /&gt;
             case &amp;quot;Divide&amp;quot;:&lt;br /&gt;
                 return x / y;&lt;br /&gt;
             default:&lt;br /&gt;
                 throw new InvalidOperationException(&amp;quot;Unsupported operation&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*After refactoring&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public abstract class Operator&lt;br /&gt;
{&lt;br /&gt;
    public abstract int Execute(int x, int y)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class Add : Operator&lt;br /&gt;
{&lt;br /&gt;
    public override int Execute(int x, int y)&lt;br /&gt;
    {&lt;br /&gt;
        return x + y;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Subtract : Operator&lt;br /&gt;
{&lt;br /&gt;
    public override int Execute(int x, int y)&lt;br /&gt;
    {&lt;br /&gt;
        return x - y;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Multiply: Operator&lt;br /&gt;
{&lt;br /&gt;
    public override int Execute(int x, int y)&lt;br /&gt;
    {&lt;br /&gt;
        return x * y;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Divide: Operator&lt;br /&gt;
{&lt;br /&gt;
    public override int Execute(int x, int y)&lt;br /&gt;
    {&lt;br /&gt;
        return x / y;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Polymorphism in object-oriented programming, http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming&lt;br /&gt;
&lt;br /&gt;
[2] Rene Santaolaya, Olivia G. Fragoso, Joaquín Pérez, Lorenzo Zambrano, Restructuring Conditional Code Structures Using Object Oriented Design Patterns, Lecture Notes in Computer Science. &lt;br /&gt;
&lt;br /&gt;
[3] Refactoring conditional statement, http://sourcemaking.com/refactoring/replace-conditional-with-polymorphism&lt;br /&gt;
&lt;br /&gt;
[4] Object Orientation Design, http://en.wikipedia.org/wiki/Object-oriented_design&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19387</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19387"/>
		<updated>2009-09-16T20:25:00Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Java Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
Before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
After rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Before encapsulation:&lt;br /&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;
&lt;br /&gt;
After encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
Before rename:&lt;br /&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;
&lt;br /&gt;
After rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
Before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
After encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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 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 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] (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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19386</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19386"/>
		<updated>2009-09-16T20:24:50Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Java Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
Before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
After rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Before encapsulation:&lt;br /&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;
&lt;br /&gt;
After encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
Before rename:&lt;br /&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;
&lt;br /&gt;
After rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
Before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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 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 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] (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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19385</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19385"/>
		<updated>2009-09-16T20:24:40Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Ruby Example of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
Before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
After rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Before encapsulation:&lt;br /&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;
&lt;br /&gt;
After encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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 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 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] (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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19384</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19384"/>
		<updated>2009-09-16T20:22:33Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Refactoring support for Current Ruby IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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 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 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] (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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19383</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=19383"/>
		<updated>2009-09-16T20:21:52Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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 ActiveState Komodo]  || N&lt;br /&gt;
 |- &lt;br /&gt;
 | [http://www.netbeans.org NetBeans] || N&lt;br /&gt;
 |-&lt;br /&gt;
 | [www.ruby-ide.com 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;
 | [www.sapphiresteel.com Ruby in Steel] || N&lt;br /&gt;
|-&lt;br /&gt;
 | [www.jetbrains.com/ruby/index.html RubyMine] || Y&lt;br /&gt;
|-&lt;br /&gt;
 | [www.eclipse.org 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19059</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=19059"/>
		<updated>2009-09-11T20:16:22Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Motivation of Refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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: Refactoring is the process of applying behavior-preserving transformations &lt;br /&gt;
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;
&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. &lt;br /&gt;
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 &lt;br /&gt;
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&lt;br /&gt;
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 &lt;br /&gt;
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 &lt;br /&gt;
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;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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. &lt;br /&gt;
 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, &lt;br /&gt;
polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples (in section 1.3, 1.4)&lt;br /&gt;
 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;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19058</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=19058"/>
		<updated>2009-09-11T20:15:31Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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: Refactoring is the process of applying behavior-preserving transformations &lt;br /&gt;
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;
&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. &lt;br /&gt;
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 &lt;br /&gt;
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&lt;br /&gt;
 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 &lt;br /&gt;
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 &lt;br /&gt;
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;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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. &lt;br /&gt;
 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, &lt;br /&gt;
polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples (in section 1.3, 1.4)&lt;br /&gt;
 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;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=19057</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=19057"/>
		<updated>2009-09-11T20:09:43Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&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: 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;
&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;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_9b_SJ&amp;diff=18696</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=18696"/>
		<updated>2009-09-08T16:39:02Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17778</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17778"/>
		<updated>2009-09-06T04:03:36Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Comparison of Ruby and Java Refactoring Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17776</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17776"/>
		<updated>2009-09-06T04:02:58Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Comparison of Ruby and Java Refactoring Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17775</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17775"/>
		<updated>2009-09-06T03:58:07Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of Using Java Refactoring Tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17774</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17774"/>
		<updated>2009-09-06T03:57:11Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Comparison of Ruby and Java refactoring tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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 Ruby. The source code is show in section 1.3.&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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17773</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17773"/>
		<updated>2009-09-06T03:56:52Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Java refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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 Ruby. The source code is show in section 1.3.&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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17772</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17772"/>
		<updated>2009-09-06T03:56:37Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Ruby refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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 Ruby. The source code is show in section 1.3.&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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17771</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17771"/>
		<updated>2009-09-06T03:55:45Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* What is code refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Code Refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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;
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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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 Ruby. The source code is show in section 1.3.&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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17770</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17770"/>
		<updated>2009-09-06T03:54:42Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Java refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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 Ruby. The source code is show in section 1.3.&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;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17769</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17769"/>
		<updated>2009-09-06T03:54:16Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Ruby refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show 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 step1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step6]]&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;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17767</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17767"/>
		<updated>2009-09-06T03:53:22Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Java refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&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 step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&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 step1]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step5]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step6]]&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;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17765</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17765"/>
		<updated>2009-09-06T03:52:58Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Java refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&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 step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&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 step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&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;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17764</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17764"/>
		<updated>2009-09-06T03:52:18Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Java refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&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 step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&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 step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17763</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17763"/>
		<updated>2009-09-06T03:50:47Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Ruby refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&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 step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17762</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17762"/>
		<updated>2009-09-06T03:49:28Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Ruby refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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 show in section 1.3.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod 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;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17761</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17761"/>
		<updated>2009-09-06T03:47:52Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Ruby Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod to &amp;quot;Hello&amp;quot; is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17760</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17760"/>
		<updated>2009-09-06T03:47:41Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Java Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Java Example of Refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod to &amp;quot;Hello&amp;quot; is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17759</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17759"/>
		<updated>2009-09-06T03:47:24Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Ruby Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod to &amp;quot;Hello&amp;quot; is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17758</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17758"/>
		<updated>2009-09-06T03:46:56Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Ruby Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod to &amp;quot;Hello&amp;quot; is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17757</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17757"/>
		<updated>2009-09-06T03:46:45Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Ruby Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
    put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod to &amp;quot;Hello&amp;quot; is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17756</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17756"/>
		<updated>2009-09-06T03:46:06Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Ruby refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Here the renaming of the method &amp;quot;badRenameMethod to &amp;quot;Hello&amp;quot; is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17755</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17755"/>
		<updated>2009-09-06T03:44:54Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Example of using Ruby refactoring tools in Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
Here the renaming of the method badRameMethod to Hello is illustrated for Ruby.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
Here the renaming of the method badRameMethod to Hello is illustrated for Java.&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17754</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17754"/>
		<updated>2009-09-06T03:41:25Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Comparison of Ruby and Java refactoring tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  ||||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17753</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17753"/>
		<updated>2009-09-06T03:41:03Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Comparison of Ruby and Java refactoring tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  || ||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17752</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17752"/>
		<updated>2009-09-06T03:40:24Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Comparison of Ruby and Java refactoring tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|1. Refactoring Options for Java in Eclipse  || ||  2. Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17751</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17751"/>
		<updated>2009-09-06T03:39:10Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness comparison:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Refactoring Options for Java in Eclipse || Refactoring Options in Eclipse for Ruby&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17750</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17750"/>
		<updated>2009-09-06T03:31:06Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Ruby vs Java in terms of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Java refactoring tools ==&lt;br /&gt;
Comprehensiveness:&lt;br /&gt;
{|Refactoring Options for Ruby in Eclipse&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Encapsulate Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Inline&lt;br /&gt;
|-&lt;br /&gt;
|Merge Class Parts in File&lt;br /&gt;
|-&lt;br /&gt;
|Merge With External Class Parts&lt;br /&gt;
|-&lt;br /&gt;
|Move&lt;br /&gt;
|-&lt;br /&gt;
|Pull Up&lt;br /&gt;
|-&lt;br /&gt;
|Pull Down&lt;br /&gt;
|-&lt;br /&gt;
|Rename&lt;br /&gt;
|-&lt;br /&gt;
|Split Local Variable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|Refactoring Options in Eclipse for Java&lt;br /&gt;
|Rename&lt;br /&gt;
|-&lt;br /&gt;
|Move&lt;br /&gt;
|-&lt;br /&gt;
|Change Method Signature&lt;br /&gt;
|-&lt;br /&gt;
|Extract Local Variable&lt;br /&gt;
|-&lt;br /&gt;
|Extract Constant&lt;br /&gt;
|-&lt;br /&gt;
|Inline&lt;br /&gt;
|-&lt;br /&gt;
|Convert Anonymous Class to Nested&lt;br /&gt;
|-&lt;br /&gt;
|Convert Member to Top Level&lt;br /&gt;
|-&lt;br /&gt;
|Convert Local Variable to Field&lt;br /&gt;
|-&lt;br /&gt;
|Extract Super Class&lt;br /&gt;
|-&lt;br /&gt;
|Extract Interface&lt;br /&gt;
|-&lt;br /&gt;
|Extract Class&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;
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 dynamically typed language, has unbounded polymorphism, and all classes are open to extension.  On the other hand, Java is statically typed, polymorphism is mainly implemented via interfaces and inheritance, and classes cannot be extended at runtime.  The given examples 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&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17747</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a SJ</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a_SJ&amp;diff=17747"/>
		<updated>2009-09-06T03:25:21Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a&amp;diff=17746</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a&amp;diff=17746"/>
		<updated>2009-09-06T03:21:39Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Sheng_yi&amp;diff=17745</id>
		<title>User:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Sheng_yi&amp;diff=17745"/>
		<updated>2009-09-06T03:20:55Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a/sheng_yi&amp;diff=17744</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a/sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a/sheng_yi&amp;diff=17744"/>
		<updated>2009-09-06T03:20:35Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Sheng_yi&amp;diff=17743</id>
		<title>User:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Sheng_yi&amp;diff=17743"/>
		<updated>2009-09-06T03:19:19Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a&amp;diff=17742</id>
		<title>CSC/ECE 517 Fall 2009/wiki 1a</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki_1a&amp;diff=17742"/>
		<updated>2009-09-06T03:13:09Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17741</id>
		<title>User talk:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17741"/>
		<updated>2009-09-06T03:02:59Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Java Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17740</id>
		<title>User talk:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17740"/>
		<updated>2009-09-06T03:00:33Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Ruby Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 put(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17739</id>
		<title>User talk:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17739"/>
		<updated>2009-09-06T02:59:07Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Java Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 (&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&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;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17738</id>
		<title>User talk:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17738"/>
		<updated>2009-09-06T02:56:08Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: /* Some Ruby Example of refactoring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
 def badRenameMethod&lt;br /&gt;
    puts(&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 (&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&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;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
&lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17737</id>
		<title>User talk:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17737"/>
		<updated>2009-09-06T02:47:36Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&gt;
&lt;br /&gt;
 def hello&lt;br /&gt;
 (&amp;quot;Hello World&amp;quot;);&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&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;
=== Some Java Example of refactoring ===&lt;br /&gt;
before rename:&lt;br /&gt;
&lt;br /&gt;
after rename:&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
before encapsulation:&lt;br /&gt;
&lt;br /&gt;
after encapsulation:&lt;br /&gt;
&lt;br /&gt;
 public class encap_field&lt;br /&gt;
 {&lt;br /&gt;
    public String field;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17735</id>
		<title>User talk:Sheng yi</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User_talk:Sheng_yi&amp;diff=17735"/>
		<updated>2009-09-06T02:36:58Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is code refactoring ==&lt;br /&gt;
According to the famous book &amp;quot;Refactoring: Improving the Design of Existing Code &amp;quot; by Martin Fowler: 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;
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 main refactoring===&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;
=== Some Ruby Example of refactoring ===&lt;br /&gt;
wait for Julian &lt;br /&gt;
=== Some Java Example of refactoring ===&lt;br /&gt;
wait for Julian&lt;br /&gt;
&lt;br /&gt;
== Refactoring support for Current Ruby IDE ==&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;
 | 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;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:r01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:r02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:r03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:r04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:r05.jpg|thumb|upright|alt= encapsulation step0]]&lt;br /&gt;
| [[Image:r06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:r07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:r08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:r09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example of using Java refactoring tools in Eclipse ===&lt;br /&gt;
example of rename: &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j00.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
| [[Image:j01.jpg|thumb|upright|alt= rename step1]]&lt;br /&gt;
| [[Image:j02.jpg|thumb|upright|alt= rename step2]]&lt;br /&gt;
| [[Image:j03.jpg|thumb|upright|alt= rename step3]]&lt;br /&gt;
| [[Image:j04.jpg|thumb|upright|alt= rename step4]]&lt;br /&gt;
| [[Image:j05.jpg|thumb|upright|alt= rename step0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
example of encapsulation: &lt;br /&gt;
{|&lt;br /&gt;
| [[Image:j06.jpg|thumb|upright|alt= encapsulation step1]]&lt;br /&gt;
| [[Image:j07.jpg|thumb|upright|alt= encapsulation step2]]&lt;br /&gt;
| [[Image:j08.jpg|thumb|upright|alt= encapsulation step3]]&lt;br /&gt;
| [[Image:j09.jpg|thumb|upright|alt= encapsulation step4]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ruby vs Java in terms of refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Thomas Corbat, Lukas Felber, Mirko Stocker&lt;br /&gt;
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 on ruby on rail, http://www.good-tutorials.com/tutorials/ruby-on-rails/refactoring&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:J09.jpg&amp;diff=17734</id>
		<title>File:J09.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:J09.jpg&amp;diff=17734"/>
		<updated>2009-09-06T02:35:52Z</updated>

		<summary type="html">&lt;p&gt;Sheng yi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sheng yi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:J08.jpg&amp;diff=17733</id>
		<title>File:J08.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:J08.jpg&amp;diff=17733"/>
		<updated>2009-09-06T02:35:39Z</updated>

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