Feeds:
Posts
Comments

Archive for the ‘refactoring’ Category

Extract supertype

When I’m working on a group of classes that offer similar functionality, I’ll want to create a parent class or interface to share functionality or allow the children to be used polymorphically. Eclipse has a couple of refactoring tools that make the process of creating the parent easier. Ctrl-Alt-T to open the refactoring menu and [...]

Read Full Post »

So many refactorings to pick from…

Ok, by now we all know that REFACTORING IS GOOD. Say it again! Testify! But with so many refactoring choices in this workaday world, how is a developer to know which one to pick? Well, in a given situation Eclipse will guide you towards refactoring bliss by showing you a neat list of all the applicable refactorings. Select [...]

Read Full Post »

Taming large methods

Next to using a chair and a whip, one of the most effective ways to tame large, complicated, methods that do many things is to refactor them into smaller more manageable methods that each do a single thing. Eclipse offers an “Extract Method” refactoring for this case. You can select a block of code that you want [...]

Read Full Post »

Did you know that Sting used to be named Gordon Sumner, that John Denver was Henry John Deutschendorf or that Michael J. Fox was Michael A. Fox? Name changes are uncommon when we’re talking about people (except in the entertainment industry, apparently) but they’re very common when we’re talking about code.
Renaming is one of the [...]

Read Full Post »