The following URLs contains some patterns that are members of a more complex pattern language. The goal of these patterns is to help people to understand HOW to refactor their programs.
These patterns were already published in two seminars and one international event (Informatics'2005, Havana, Cuba). I'm currently refining them to include the complete language in a comming AW book.
Please, I would appreciate all the help (and light) you can bring me. Post the comments here.
Thanks in advance.
- Backtrack If Refactoring Fails
http://svpino.blogspot.com/2005/10/backtrack-if-refactoring-fails.html
- The First Refactoring Step
http://svpino.blogspot.com/2005/10/first-refactoring-step.html
- Refactoring In Very Small Steps
http://svpino.blogspot.com/2005/10/refactoring-in-very-small-steps.html
- Test Every Refactoring
http://svpino.blogspot.com/2005/10/test-every-refactoring.html
- Refactoring Using Tools
http://svpino.blogspot.com/2005/10/refactoring-using-tools.html
-
Refactoring Patterns (9 messages)
- Posted by: Santiago Valdarrama
- Posted on: October 31 2005 00:31 EST
Threaded Messages (9)
- Refactoring Patterns by Sachin Dharmapurikar on October 31 2005 12:02 EST
- good books for developper point of view by St?phan Mestach on October 31 2005 13:01 EST
- RE: good books for developper point of view by Santiago Valdarrama on October 31 2005 04:38 EST
- good books for developper point of view by St?phan Mestach on October 31 2005 13:01 EST
- Any technical comment? by Santiago Valdarrama on November 02 2005 15:59 EST
- Processes rather than Patterns. by Ajith Kallambella on December 06 2005 09:43 EST
- Processes rather than Patterns. by Rohit Sood on December 27 2005 00:12 EST
- Refactoring Patterns using Eclipse by vijay kumar on March 21 2006 05:14 EST
- Refactoring Patterns by John Gagon on May 11 2006 05:59 EDT
- Examples will be quite handy by Vijay Kumar Narayanan on May 22 2006 21:14 EDT
-
Refactoring Patterns[ Go to top ]
- Posted by: Sachin Dharmapurikar
- Posted on: October 31 2005 12:02 EST
- in response to Santiago Valdarrama
Well, first of all thanks for consolidating such good information for users on refactoring. I will add my one experience of refactoring to this. In a code when you want to refactor specially flag variables, you need to confirm each and every occurance and consider its scope. Previously I used to use the Search/Find feature of editor, then I moved to Eclipse. Eclipse refactor doesn't only reduce whole operation to few clicks but it takes care of all issues like scope of variable and its multiple occurances.
Please share your experiences as well, so that we can avoid such mistakes in future. -
good books for developper point of view[ Go to top ]
- Posted by: St?phan Mestach
- Posted on: October 31 2005 13:01 EST
- in response to Sachin Dharmapurikar
for developpers that have coded like pigs...
import java.pigs.*;
it's hard to make them learn "with patterns" so it's better to start with their "ugly" code and show how it can be improved
these 2 books try to do so :
http://agileskills.org/
http://www.martinfowler.com/books.html#refactoring -
RE: good books for developper point of view[ Go to top ]
- Posted by: Santiago Valdarrama
- Posted on: October 31 2005 16:38 EST
- in response to St?phan Mestach
I agree with you that the best way to make developers learn refactoring is with the form of
ugly code --> clean code after refactoring
but my intention isn't instruct developers about the mechanics of refactoring but HOW, WHEN, WHERE and WHAT is refactoring. This is why I use patterns. If you look carefully to a couple of patterns I've published previously, you will discover that they do not include source code because they existence is not bind to any language neither code. These patterns will show another kind of valuable information.
Thanks for your comments. -
Any technical comment?[ Go to top ]
- Posted by: Santiago Valdarrama
- Posted on: November 02 2005 15:59 EST
- in response to Santiago Valdarrama
Any technical comment? -
Processes rather than Patterns.[ Go to top ]
- Posted by: Ajith Kallambella
- Posted on: December 06 2005 09:43 EST
- in response to Santiago Valdarrama
IMHO what you are calling Patterns here are actually Processes executed before,during and after refactoring. It is a good checklist, but I'm afraid you are trying to fit refactoring activities into the pattern mold. Perhaps you could call them "Refactoring Process Patterns" ?
I would also like to see emphasis on continuous refactoring in your list. There is a dangerously fast growing perception that refactoring is a one-time effort.
-Ajith Kallambella. -
Processes rather than Patterns.[ Go to top ]
- Posted by: Rohit Sood
- Posted on: December 27 2005 00:12 EST
- in response to Ajith Kallambella
Good general information posted - these are certainly common sense approaches to refactoring. I find myself following the process/patterns described.
I certainly agree that these are not design patterns yet the material is presented as such. -
Refactoring Patterns using Eclipse[ Go to top ]
- Posted by: vijay kumar
- Posted on: March 21 2006 05:14 EST
- in response to Santiago Valdarrama
Eclipse gives good support for refactoring. You can try
this simple method extract functionality in eclipse.
1. Select few statements within a method,
2. Right Click --> Refactor --> ExtractMethod --> Give a
method name and click OK, it automatically creates the
Method parameters according to selection.
Will post few more refactor tips if interested -
Refactoring Patterns[ Go to top ]
- Posted by: John Gagon
- Posted on: May 11 2006 05:59 EDT
- in response to Santiago Valdarrama
Refactorings like Patterns solve particular problems. Patterns however also model common structures and life cycles amongst types. Refactorings seem to deal heavily in smaller elements than types. (functions or methods where much complex "stinky" code happens). I think refactorings are more "techniques" but all the same it is great that there is more documentation and thought about the relationship here between Patterns and refactorings as there are definite "idea overlaps" there. Thank you for the great info. -
Examples will be quite handy[ Go to top ]
- Posted by: Vijay Kumar Narayanan
- Posted on: May 22 2006 21:14 EDT
- in response to Santiago Valdarrama
Good work Santiago. I guess this will some real examples will be very helpful and will reach the developers in a quick efficient way. Also, it is not a bad idea to show UML diagrams before and after refactoring. Cheers... VJ