|
From: <mir...@us...> - 2007-02-26 07:36:25
|
Revision: 2035
http://svn.sourceforge.net/rubyeclipse/?rev=2035&view=rev
Author: mirkostocker
Date: 2007-02-25 23:36:22 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
Some documentation about the refactorings, just to get an overview.. it would be nice if a native english speaker could review it :)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.doc.user/docbook.xml
Modified: trunk/org.rubypeople.rdt.doc.user/docbook.xml
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-25 15:54:06 UTC (rev 2034)
+++ trunk/org.rubypeople.rdt.doc.user/docbook.xml 2007-02-26 07:36:22 UTC (rev 2035)
@@ -210,6 +210,129 @@
</warning>
</section>
</section>
+ <section id="Refactoring">
+ <title>Refactoring</title>
+ <para>RDT contains several automated refactorings for improving your code and
+ making some tasks easier, like the generation of accessors. The refactorings
+ are available through the menu bar as well as the context menu of the editor
+ and the outline view. The following refactorings are available:</para>
+ <itemizedlist>
+ <listitem>Convert Local Variable to Field</listitem>
+ <listitem>Encapsulate Field</listitem>
+ <listitem>Extract Method</listitem>
+ <listitem>Generate Accessors</listitem>
+ <listitem>Generate Constructor using Fields</listitem>
+ <listitem>Inline Class</listitem>
+ <listitem>Inline Method</listitem>
+ <listitem>Inline Temp</listitem>
+ <listitem>Merge Class Parts</listitem>
+ <listitem>Move Field</listitem>
+ <listitem>Move Method</listitem>
+ <listitem>Override Method</listitem>
+ <listitem>Push Down Method</listitem>
+ <listitem>Rename Class, Field, Method and Local Variable</listitem>
+ <listitem>Split Local Variable</listitem>
+ </itemizedlist>
+ <section id="ConvertLocalVariableToField">
+ <title>Convert Local Variable to Field</title>
+ <para>This refactoring converts a local variable into a field. This will
+ grant access to a variable that was only accessible inside a method or
+ block to the whole class.</para>
+ </section>
+ <section id="EncapsulateField">
+ <title>Encapsulate Field</title>
+ <para>The Encapsulate Field refactoring means that you take a field and
+ hide access to it behind getter and setter methods. This can be done for
+ external access as well as from inside the class.</para>
+ </section>
+ <section id="ExtractMethod">
+ <title>Extract Method</title>
+ <para>Extract Method removes a block of instructions out of an existing method
+ and creates a new one, that contains this functionality. The new method
+ will be called from the existing one where the instructions have been
+ removed. The local variables from the existing method that are used in
+ the affected code block are passed to the new method as parameters.
+ If one of those local variables is set inside the selected block it will
+ be returned from the new method as its return value.</para>
+ </section>
+ <section id="GenerateAccessors">
+ <title>Generate Accessors</title>
+ <para>Generate Accessors can be used to generate getter and setter methods for
+ fields of a class. The user can choose whether reader and / or writers
+ are generated and if they should be inserted as methods or in the short
+ form using <varname>attr_reader</varname>, <varname>attr_writer</varname>
+ or <varname>attr_accessor</varname>.</para>
+ </section>
+ <section id="GenerateConstructorUsingFields">
+ <title>Generate Constructor using Fields</title>
+ <para>The code generator Generate Constructor Using Fields creates a new constructor.
+ The constructor will have a variable number of arguments, which can be
+ selected from a list of the existing fields in the class. In the constructor's
+ body, the class fields will be initialized with the values of the constructor's
+ parameters.</para>
+ </section>
+ <section id="InlineClass">
+ <title>Inline Class</title>
+ <para>The Inline Class refactoring integrates the code from a usually small class which
+ had not much functionality into another class. Usually the target class uses
+ the inlined one.</para>
+ </section>
+ <section id="InlineMethod">
+ <title>Inline Method</title>
+ <para>The Inline Method refactoring removes a method and replaces the call with its content.
+ This might make sense if you have almost empty methods without much logic, perhaps
+ after applying other refactorings. Generally having multiple methods with clear
+ names is better than one big chunk of code.</para>
+ </section>
+ <section id="InlineTemp">
+ <title>Inline Temp</title>
+ <para>The Inline Temp refactoring replaces all occurrences of a local variable with the value
+ it got assigned once. Furthermore the assignment is removed as it will not be used
+ anymore. Usually this refactoring is used to simplify other refactorings or if it
+ does not make sense to keep the variable as it makes the code just more complex.</para>
+ </section>
+ <section id="MergeClassParts">
+ <title>Merge Class Parts</title>
+ <para>The Merge Ruby Class Parts refactoring pulls class declarations together and merges them
+ into one single part.</para>
+ </section>
+ <section id="MoveField">
+ <title>Move Field</title>
+ <para>This refactoring moves, as its name says, a field from one class into another one. This
+ is useful if you realize that the responsibility for a field is not in the owning class,
+ but in another one. In this case, the field should better be moved to that class.</para>
+ </section>
+ <section id="MoveMethod">
+ <title>Move Method</title>
+ <para>The Move Method refactoring behaves almost like the Move Field refactoring, except that it
+ moves methods instead of fields. This is useful if you come across a method in a class
+ that is not really responsible for the functionality provided by this method.</para>
+ </section>
+ <section id="OverrideMethod">
+ <title>Override Method</title>
+ <para>The Override Method code generator creates method bodies for a class. You can
+ choose among the methods of the super class and those methods will be overridden
+ in the class. The added methods will have the same signature as the one from the
+ super class and call super.</para>
+ </section>
+ <section id="PushDownMethod">
+ <title>Push Down Method</title>
+ <para>The Push Down Method refactoring removes a method from the super class and pastes it
+ into all its child classes.</para>
+ </section>
+ <section id="Rename">
+ <title>Rename Class, Field, Method and Local Variable</title>
+ <para>The rename refactorings can be used to change the name of various elements of your code.</para>
+ </section>
+ <section id="SplitLocalVariable">
+ <title>Split Local Variable</title>
+ <para>Programmers, especially inexperienced ones, sometimes tend to assign a temporary variable several
+ times. The fact that Ruby does not have typed references might misleadingly encourage this.
+ This is not recommendable because this means, that the temporary variable takes various
+ responsibilities and thus can not be named properly. So the Split Temporary Variables refactoring
+ helps avoiding this by creating a new temporary variable for each responsibility.</para>
+ </section>
+ </section>
<section id ="ConsoleView">
<title>Console View</title>
<para>The console view contains the output of a program. If the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|