views:

80

answers:

2

Hi

I am a relatively new user of Visual Studio and I am trying "program against interfaces". I can see that when I create a class I can "Extract Interface" from the Refactor menu but you seem to only get one shot at this.

ie. If I add a read only property FullName to my Customer class I would like to be able to right click and update the interface. At the moment I can only create a new interface from the Refactor menu. I want to update the interface I have already created not create new one.

So the kind of tool I would be looking for would display check boxes for all valid members of the class with those already in the interface checked. It would also be handy to be able to to create the initial interface file in a different project (in the same solution), and for the tool to keep track of this.

Does such a tool / add in / menu item exist (other than Ctrl C / V)?

Thanks, John

+4  A: 

ReSharper is your friend John. :)

It has many refactoring tools, including "Pull members up" which will update interfaces in your case:

http://www.jetbrains.com/resharper/

An excellent Visual Studio add-in in many ways...

chibacity
Thanks I'll give reshaper a try
John
+4  A: 

CodeRush Xpress is a good free alternative (although limited compared to the full version and ReSharper).

CRX

Span
Thanks for the tip - I have just had a look at CodeRush / Refator Pro trial and it doesn't seem to have that feature yet - though it has a whole lot of other cool stuff !!
John
MY LAST COMMENT WAS NOT CORRECTThis functionality IS supported - (using demo version of professional it may not be in express) So it looks like either CodeRush or Reshaper will do the job. In my case I am sticking with CodeRush as I already have it installed.
John