freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [FR-devel] Renaming methods...


From: Curt Hibbs
Subject: RE: [FR-devel] Renaming methods...
Date: Mon, 6 Oct 2003 21:44:14 -0500

Hal Fulton wrote:
>
> *Some* refactoring tasks may be automated without too much trouble.
> This one seems problematic to me.
>
> The more I think about this, the more perturbed I am.
>
> I think that the (outwardly relatively simple) task of renaming a method
> is going to require a full parser and maybe even some artificial
> intelligence.
>
> Suppose classes X and Y each have a foobar method; and I want to change
> X's foobar to blah.
>
> In code, how can I distinguish these? I may see
>
>    a.foobar
>    b.foobar
>
> How could I possibly know which one to change?

I think for things like this the best we can do is to offer assistance (as
opposed to full automation).

For example, you could present the user with a list of all uses of "foobar"
and ask him to select the ones that should be changed. Even this rudimentary
assistance is far better than having to do it manually.

Later on, more sophisticated methods could be employed.

> I could look for something like  a = Y.new  but that is clumsy; and
> what about branching and so on?
>
> And what about
>
>    z = some_method_which_may_return_X_or_Y
>    z.foobar
>
> How on earth do they do this reliably in Smalltalk?

I've been away from smalltalk for too long, I can't remember (although its
possible they also present the user with a list).

Curt





reply via email to

[Prev in Thread] Current Thread [Next in Thread]