RSS Feed for RefactoringCategory: Refactoring

Java: Refactoring Methods »

Here are the guidelines that we follow to refactor the methods in one of the legacy Java application, simplified from Martin Fowler refactoring book. Rename a method to server its purpose Add a parameter to the method if it is required Remove a parameter if it is not required Separate query from modifier and let […]

Java: Refactor Code by Introducing NULL Object »

This is from the Refactoring book by Martin Fowler. In our code we always need to check if a object is null, and depending on it, different actions are taken. E.g. for the following code 1: if (subscriber == null) { 2: ratePlan = defaultRatePlan; 3: } else { 4: ratePlan = subscriber.getRatePlan(); 5: } […]