Re: Diamond back refactoring (again, I know...)

From: Jim Cooper (jim.cooper_at_virgin.net)
Date: 09/24/04


Date: Fri, 24 Sep 2004 08:42:34 +0100


> Especially when writing libraries renaming in a non local scope is more
> damaging than useful.

I'm sure I've missed your point here. Why is that so? The Rename
refactoring only renames what it should. It's not the old search and
replace, but a smart, context-aware version. AFAIK it won't cross
project boundaries though (or maybe project group boundaries if you have
them)

Or are you talking about changing the public interface? In that case,
then yes, but that's an issue for you no matter what refactoring you do,
either by hand or mechanically. There are a number of issues with
refactoring generally. That's one, the other big one for some people is
that the Fowler refactorings are not thread-safe (necessarily). There
are others.

> Extracting a method will by default occur on a
> local scope and be of no harm in that context.

The extracted method is made protected, if that's what you mean.
Although adding to a public interface is not necessarily bad.

> The extract ancestor class should be safe though.

I must confess I didn't see the difference between that and Extract
Superclass :-)

> Even so I must say I find renaming quite useful, in a non library
> context, since classes are merely specialized fragments of a greater
> whole and thereby easily subject to change (if just by name).

Yes, it is useful, and it works on much more than class names too.

Cheers,
Jim Cooper

_______________________________________________

Jim Cooper jim@falafelsoft.com
Falafel Software http://www.falafelsoft.co.uk
_______________________________________________



Relevant Pages

  • Re: After a few days with VS.NET 2005
    ... It's called "RENAME" under refactoring. ... see a class in a concise manner like you could in C++, Delphi, etc. ... and not because the Delphi language requires ...
    (borland.public.delphi.non-technical)
  • Re: Delphi 2006... The Beast! The Best !
    ... > I've used both "Rename" and ... > "Extract Method" in this proof of concept console app I dreamed up that as ... this is the big draw of refactoring. ... having to worry about mistakes. ...
    (borland.public.delphi.non-technical)
  • Re: Rename ignores extra files
    ... used as a 'test' for trying out control arrangments and property ... settings in an attempt to duplicate another problem with a 3rd party ... As for refactoring ... I have to manually rename them as well. ...
    (microsoft.public.vstudio.general)
  • Re: Two Small Suggestions
    ... The reason it works as it does is because if you rename at any other ... preserving refactoring. ... safer to rename at global scope (ignoring external dependencies such as ...
    (comp.lang.smalltalk.dolphin)
  • Re: Java classes and package renaming tool?
    ... >I'm refactoring some existing java code soon, and I need to rename quite ... If I'm not mistaken, this action of renaming classes and packages, ... between classes is called refactoring. ...
    (comp.lang.java.programmer)