View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Ways to Speed Up Your Coding in VisualWorks

REFACTOR YOUR CODE IN A COUPLE OF SECONDS



Instead of rewriting the piece of code or even copy and pasting, here's a simpler way I discovered while coding in VisualWorkds IDE

First start up your browswer from the main console screen by choosing Browse menu:

Browse>>System

amd then left-clicking the mouse. You can also hit F5 on your keyboard after the console is higlighted.(see below)

Uploaded Image: start.GIF
start.bmp

Then highlight the piece of code you want to REFACTOR. If there are local variables, make sure you highlight the declarations.
Instance variables are acknowledged automatically. So you can highlight instance variables and still proceed with refactoring.
Then right click the mouse and go up to Refactor and then click "Extract Method" (see below)


Uploaded Image: refactor.GIF
refactor.bmp

then type in the selector (message) you want this piece of code to be under(shown below).

Uploaded Image: selectMethod.GIF
selectMethod.bmp

then click "OK" button. You are done.

Uploaded Image: replaced.GIF
replaced.bmp

Check to make sure the new message (method) has been created.
and then check to make sure that the message is called from the code where the original code was extracted (as shown below)


Uploaded Image: end.GIF
end.bmp

DO NOT try to refactor code into already existing message. It seems to overwrite the previous message, posing a grave risk of loss of code.



Links to this Page

  • Cases last edited on 30 July 2011 at 2:33 am by r59h132.res.gatech.edu
  • Index of Individual Cases last edited on 3 May 2011 at 12:46 pm by r52h48.res.gatech.edu