Refactoring in Java vs. Ruby

Conventional wisdom has it that automated refactoring support is good in Java because it is statically typed, and poor (or non-existent) in Ruby because it is dynamically type. This may be true up to a point, but breaks down quickly when your Java app uses reflection, AOP, or has code references in XML configuration files.

Murphee has written a really good exposition of this issue:

Sure… when you use the refactoring tools in Eclipse (for instance, I guess other IDEs do that too), you can tell it to look at textual resources too. But that‘s no real help here… because looking for “getTheGuysName” in JSP files won‘t help, because the property’s name in the JSP file is “TheGuysName“.

And it doesn‘t end here. If you‘ve been following the Java space at all then you’ll know that it gets more and more common to wire things together with text files (XML or others).

If you’re interested in the issues that surround refectoring, this is definitely worth reading.

Thanks to Obie for bringing this to my attention.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s