<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://dev.eiffel.com/index.php?action=history&amp;feed=atom&amp;title=Refactoring</id>
		<title>Refactoring - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://dev.eiffel.com/index.php?action=history&amp;feed=atom&amp;title=Refactoring"/>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Refactoring&amp;action=history"/>
		<updated>2026-05-28T06:44:04Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Refactoring&amp;diff=9256&amp;oldid=prev</id>
		<title>Bertrand Meyer at 21:25, 8 August 2007</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Refactoring&amp;diff=9256&amp;oldid=prev"/>
				<updated>2007-08-08T21:25:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:25, 8 August 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:EiffelStudio]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:EiffelStudio]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{NoProjectMembers}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__TOC__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==General considerations==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==General considerations==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To avoid problems with changes from the user it may make sense for each changed text to save/discard it before doing the refactoring. After this the code should be checked and only if it is valid continued. After the refactoring, the code could be checked again and all views where something has changed should be updated to show the changes. This could be implemented, by compiling before doing the refactoring and compiling after the refactoring.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To avoid problems with changes from the user it may make sense for each changed text to save/discard it before doing the refactoring. After this the code should be checked and only if it is valid continued. After the refactoring, the code could be checked again and all views where something has changed should be updated to show the changes. This could be implemented, by compiling before doing the refactoring and compiling after the refactoring.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bertrand Meyer</name></author>	</entry>

	<entry>
		<id>https://dev.eiffel.com/index.php?title=Refactoring&amp;diff=1777&amp;oldid=prev</id>
		<title>Manus at 14:46, 8 April 2006</title>
		<link rel="alternate" type="text/html" href="https://dev.eiffel.com/index.php?title=Refactoring&amp;diff=1777&amp;oldid=prev"/>
				<updated>2006-04-08T14:46:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:EiffelStudio]]&lt;br /&gt;
==General considerations==&lt;br /&gt;
To avoid problems with changes from the user it may make sense for each changed text to save/discard it before doing the refactoring. After this the code should be checked and only if it is valid continued. After the refactoring, the code could be checked again and all views where something has changed should be updated to show the changes. This could be implemented, by compiling before doing the refactoring and compiling after the refactoring.&lt;br /&gt;
&lt;br /&gt;
It could be a good idea to work &amp;quot;atomic&amp;quot; on a class/file basis, that means only if everything went ok, the changes will be written to the file. It would also be useful if all the changes to the different files were logged in an undo log, so that they could be rolled back (either if something bad happens or if the user wants to undo the refactoring).&lt;br /&gt;
&lt;br /&gt;
At the moment there are already some tools for refactoring or things that have a lot in common with refactoring.&lt;br /&gt;
*tools under Edit, Advanced&lt;br /&gt;
*various things in the diagram view&lt;br /&gt;
*some of the auto insertions&lt;br /&gt;
*search and replace&lt;br /&gt;
Maybe the difference between things like under Edit, Advanced and &amp;quot;normal&amp;quot; refactoring is, that refactoring can affect the whole universe. But both things could still share a lot of common functionality.&lt;br /&gt;
&lt;br /&gt;
Another thing that could be very helpful is the possibility to optionally show each change to the user and let him decide if this realy should be done (preview).&lt;br /&gt;
&lt;br /&gt;
==Possible design==&lt;br /&gt;
===Low level text editing===&lt;br /&gt;
For refactoring it is useful to have some text editing functionality. A preview functionality could alse be implemented on this level. This could also log every change and make the undo log. At the moment, the class CLASS_TEXT_MODIFIER has most of this things already implemented.&lt;br /&gt;
*insert_code&lt;br /&gt;
*remove_code&lt;br /&gt;
*replace_code&lt;br /&gt;
*get_code&lt;br /&gt;
*index_of&lt;br /&gt;
*some kind of undo log, where a whole bunch of changes can be put together in &amp;quot;transactions&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Syntactic editing===&lt;br /&gt;
On a higher level, there should be tools that allow to make more complex things. At the moment, some of this things are implemented in CLASS_TEXT_MODIFIER and EB_FEATURE_EDITOR.&lt;br /&gt;
====common====&lt;br /&gt;
*create/change/remove comment&lt;br /&gt;
&lt;br /&gt;
====cluster====&lt;br /&gt;
*create cluster&lt;br /&gt;
*change cluster&lt;br /&gt;
*remove cluster&lt;br /&gt;
&lt;br /&gt;
====class====&lt;br /&gt;
*create class&lt;br /&gt;
*change class&lt;br /&gt;
**rename&lt;br /&gt;
**add/remove inheritance&lt;br /&gt;
*remove class&lt;br /&gt;
&lt;br /&gt;
====feature====&lt;br /&gt;
*create feature&lt;br /&gt;
*change feature&lt;br /&gt;
*remove feature&lt;br /&gt;
&lt;br /&gt;
===Refactoring===&lt;br /&gt;
====Preferences====&lt;br /&gt;
*global settings&lt;br /&gt;
*refactoring specific settings&lt;br /&gt;
**normal preferences&lt;br /&gt;
**set before run (but also implemented as normal preferences but hidden)&lt;br /&gt;
&lt;br /&gt;
====Run====&lt;br /&gt;
#settings&lt;br /&gt;
##Ask the user some settings for this run and store them as normal preferences&lt;br /&gt;
#checks if refactoring is possible&lt;br /&gt;
#which classes are affected&lt;br /&gt;
#refactoring&lt;br /&gt;
##get content&lt;br /&gt;
##make refactoring using Syntactic editing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[eiffel,N]&lt;br /&gt;
deferred class&lt;br /&gt;
    ERF_REFACTORING&lt;br /&gt;
&lt;br /&gt;
feature&lt;br /&gt;
    name: STRING&lt;br /&gt;
            -- Name of the refactoring.&lt;br /&gt;
&lt;br /&gt;
    description: STRING&lt;br /&gt;
            -- A description for this refactoring.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    preferences: EB_PREFERENCES&lt;br /&gt;
            -- The preferences for this refactoring.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ask_run_settings is&lt;br /&gt;
            -- Ask for the settings, that are run specific (optional).&lt;br /&gt;
        do&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    checks: LIST [ERF_CHECK] is&lt;br /&gt;
            -- The checks that need to be run before this refactoring can be run.&lt;br /&gt;
        do&lt;br /&gt;
            create list.make&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    affected_classes: LIST [CLASS_I] is&lt;br /&gt;
            -- Get the affected classes.&lt;br /&gt;
        do&lt;br /&gt;
            create liste.make&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    apply_to_project is&lt;br /&gt;
            -- Make project global changes (eg. *.ace, create/remove/rename cluster, ...) (optional).&lt;br /&gt;
        do&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    apply_to_class (a_class: CLASS_I) is&lt;br /&gt;
            -- Make the changes in `a_class'. (optional? would allow to make &amp;quot;refactorings&amp;quot; that are only checks).&lt;br /&gt;
        do&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[eiffel,N]&lt;br /&gt;
deferred class&lt;br /&gt;
    ERF_CHECK&lt;br /&gt;
&lt;br /&gt;
feature&lt;br /&gt;
    do_check is&lt;br /&gt;
            -- Execute a check.&lt;br /&gt;
        deferred&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
    success: BOOLEAN&lt;br /&gt;
            -- Did the check succeed?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[eiffel,N]&lt;br /&gt;
class&lt;br /&gt;
    ERF_REFACTORING_MANAGER&lt;br /&gt;
&lt;br /&gt;
feature&lt;br /&gt;
    register (a_refactoring: ERF_REFACTORING) is&lt;br /&gt;
            -- Register a new refactoring. Does everything that is needed (eg. add preferences, create menu item, ...)&lt;br /&gt;
    do&lt;br /&gt;
       -- ...&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Refactoring possibilities==&lt;br /&gt;
&lt;br /&gt;
A list of common known refactoring possibilities can be found here: &lt;br /&gt;
*http://en.wikipedia.org/wiki/Refactoring&lt;br /&gt;
*http://www.refactoring.com/catalog/index.html&lt;br /&gt;
*http://industriallogic.com/xp/refactoring/catalog.html&lt;br /&gt;
&lt;br /&gt;
===Rename class===&lt;br /&gt;
====Prerequisite====&lt;br /&gt;
*full code of a class (or filename)&lt;br /&gt;
*possibility to change a filename (=&amp;gt; at least get filename)&lt;br /&gt;
*list of all classes&lt;br /&gt;
*list of all clients of a class&lt;br /&gt;
*position where a certain class is defined/used&lt;br /&gt;
*position of comments&lt;br /&gt;
*position of strings&lt;br /&gt;
*(root_class settings in ace file)&lt;br /&gt;
*(other settings in project/ace file that specify a class)&lt;br /&gt;
&lt;br /&gt;
====Options====&lt;br /&gt;
*also rename file&lt;br /&gt;
*update comments&lt;br /&gt;
*update strings&lt;br /&gt;
&lt;br /&gt;
====Checks====&lt;br /&gt;
*does another class have the same name&lt;br /&gt;
&lt;br /&gt;
====Things to do====&lt;br /&gt;
*[rename file]&lt;br /&gt;
*rename class itself&lt;br /&gt;
*rename class usage&lt;br /&gt;
**var: CLASSNAME&lt;br /&gt;
**precursor&lt;br /&gt;
**agent&lt;br /&gt;
**inherit&lt;br /&gt;
**...&lt;br /&gt;
*update ace file&lt;br /&gt;
**because it is root class&lt;br /&gt;
**cecil&lt;br /&gt;
*[update comments]&lt;br /&gt;
*[update strings]&lt;br /&gt;
&lt;br /&gt;
===Rename feature===&lt;br /&gt;
====Prerequisite====&lt;br /&gt;
*full code of a class (or filename)&lt;br /&gt;
*list of classes that inherit (directly or indirectly) from a certain class&lt;br /&gt;
*list of classes that are parent (directly or indirectly) of a certain class&lt;br /&gt;
*list of all features in one class&lt;br /&gt;
*list of all assigners/callers of a feature&lt;br /&gt;
*position of feature definition/usage&lt;br /&gt;
*position of comments&lt;br /&gt;
*position of strings&lt;br /&gt;
*(access to root feature settings in ace file)&lt;br /&gt;
&lt;br /&gt;
====Options====&lt;br /&gt;
*update comments&lt;br /&gt;
*update strings&lt;br /&gt;
&lt;br /&gt;
====Checks====&lt;br /&gt;
*does another feature in the class have the new name?&lt;br /&gt;
*problems further down&lt;br /&gt;
**feature gets renamed to this name&lt;br /&gt;
**another feature gets renamed to this name&lt;br /&gt;
**merging of this feature&lt;br /&gt;
**...&lt;br /&gt;
&lt;br /&gt;
====Things to do====&lt;br /&gt;
*rename feature&lt;br /&gt;
*rename feature usage&lt;br /&gt;
**calls&lt;br /&gt;
**inheritance&lt;br /&gt;
***merge&lt;br /&gt;
***rename&lt;br /&gt;
***...&lt;br /&gt;
*rename feature in project file if it is root feature&lt;br /&gt;
*[update comments]&lt;br /&gt;
*[update strings]&lt;br /&gt;
&lt;br /&gt;
===Move feature to parent===&lt;br /&gt;
====Prerequisite====&lt;br /&gt;
*full code of a class (or filename)&lt;br /&gt;
*direct parents of a certain class&lt;br /&gt;
*list of features of a class&lt;br /&gt;
*position of a feature&lt;br /&gt;
*position where a feature can be added to a class&lt;br /&gt;
&lt;br /&gt;
====Options====&lt;br /&gt;
*which parent? (only possible if at least one parent)&lt;br /&gt;
&lt;br /&gt;
====Checks====&lt;br /&gt;
*already feature with same name in parent&lt;br /&gt;
*is feature inherited&lt;br /&gt;
&lt;br /&gt;
====Things to do====&lt;br /&gt;
*create feature in parent&lt;br /&gt;
*remove feature in class&lt;br /&gt;
&lt;br /&gt;
===Add inheritance===&lt;br /&gt;
====Prerequisite====&lt;br /&gt;
*full code of a class (or filename)&lt;br /&gt;
*list of classes that inherit (directly or indirectly) from a certain class&lt;br /&gt;
*list of classes that are parent (directly or indirectly) of a certain class&lt;br /&gt;
*position where an inherit clause can be added to a certain class&lt;br /&gt;
&lt;br /&gt;
====Options====&lt;br /&gt;
*handling of features defined in class and parent&lt;br /&gt;
&lt;br /&gt;
====Checks====&lt;br /&gt;
*no cyclic inheritance&lt;br /&gt;
&lt;br /&gt;
====Things to do====&lt;br /&gt;
*add inheritance clause&lt;br /&gt;
*handle features defined in class and parent&lt;/div&gt;</summary>
		<author><name>Manus</name></author>	</entry>

	</feed>