Refactoring classes to be included in the Value Edition?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Refactoring classes to be included in the Value Edition?

TimM-3
After a conversation a while back about why there is no "Copy class"
functionality available - I decided to write one...

Its pretty easy - but actually quite trivial if you use the
CopyClassRefactoring class thats already in the image. But then it occurred
to me that this might not be in the value edition (where most people are
likely to want that functionality). Am I correct that its bad to rely on
this class (not that its so hard to write my own e.g.

newClass := aClassToSubclass
  subclass: aStringNewName
  instanceVariableNames: aClass instanceVariableString
  classVariableNames: aClass classVariableString
  poolDictionaries: aClass sharedVariableString
  classInstanceVariableNames: aClass class instanceVariableString.

 newClass owningPackage: aPackage.

 newClass copyAllCategoriesFrom: aClass.
 newClass class copyAllCategoriesFrom: aClass class.


Reply | Threaded
Open this post in threaded view
|

Re: Refactoring classes to be included in the Value Edition?

Blair McGlashan
"TimM" <[hidden email]> wrote in message
news:[hidden email]...
> After a conversation a while back about why there is no "Copy class"
> functionality available - I decided to write one...
>

Ah, but there is (at least in b2). Try right dragging a class and dropping
it under the place where you want to copy it.

It's implemented as a composite refactoring, and is relatively
sophisticated. Nevertheless your feedback is welcome.

Regards


Blair


Reply | Threaded
Open this post in threaded view
|

Re: Refactoring classes to be included in the Value Edition?

TimM-3
> Ah, but there is (at least in b2). Try right dragging a class and dropping
> it under the place where you want to copy it.
>
> It's implemented as a composite refactoring, and is relatively
> sophisticated. Nevertheless your feedback is welcome.

Hey, thanks for following up, unfortunately the first thing I tried to do
didnt' work... ;-)

I guess I had a different scenario in mind than you... In my package I have
a visitor object and I just wanted to copy it and make a few modifications -
e.g. collect slightly different results. When I try and drag it back into my
own package (e.g. copy here) it does nothing - presumably becuase you
weren't expecting it to already be there? I was expecting it to ask me for a
new name (or do the windows - Copy Of Name hack).

Still it seems like a fairly easy case to handle.

If not - I've got my bit of painstakingly crafted code ;-)  (sigh... should
have known you had thought of everything...)