refactoring capabilities?

We did a fair job of seperating our business code from our datatier code. Unforunately, we implemented all the bl and dt classes as static classes. This tight coupling makes it tough to write unit tests. We need to refactor our code to facilitate practical unit testing.

1. Can Re-sharper refactor static methods to instance methods?
2. Can Re-sharper extract all instance methods to a new interface in a new assembly and make the class implement the new interface?
3. Can Re-sharper do 1 & 2 in bulk fashion (not me manually using re-sharper to refactor each class / method one by one)?



thanks!

1 comment

Hello,

#1 yes, look at Make method non-static refactoring
#2 yes, though interface will be created nearby, you will have to move it
to other assembly if you wish
#3 no, I don't think you can make "automagically".

Also, check my post about converting to components, may be you can invent
a good combo? http://resharper.blogspot.com/2008/06/resharper-combos-refactoring-to.html

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> We did a fair job of seperating our business code from our datatier
IR> code. Unforunately, we implemented all the bl and dt classes as
IR> static classes. This tight coupling makes it tough to write unit
IR> tests. We need to refactor our code to facilitate practical unit
IR> testing.
IR>
IR> 1. Can Re-sharper refactor static methods to instance methods?
IR>
IR> 2. Can Re-sharper extract all instance methods to a new interface
IR> in a new assembly and make the class implement the new interface?
IR>
IR> 3. Can Re-sharper do 1 & 2 in bulk fashion (not me manually using
IR> re-sharper to refactor each class / method one by one)?
IR>
IR> thanks!
IR>


0

Please sign in to leave a comment.