tags:

views:

68

answers:

1

if there is an interface and a class that implements it and you want to have the the xml comment on it to be used in VS intellisense or documentation where would you put the xml comment? on the interface's methods or on the concrete class methods? What is the correct way?

My thoughts are to put it in the interface because we are declaring the variables using interface. And i think its redundant if i also put a comment on the concrete class and see this may lead to different documentation on same method.

Any ideas, advice?

+3  A: 

You should document on any public member. If you've implemented ISomeInterface.SomeMember as public void SomeMember then it should be documented. For one thing the reader will see this as part of your class, and only by reading documentation (which they can't know to look at if it isn't there) will they know it's defined in that interface. If it's implemented as void ISomeInterface.SomeMember then it's less important, as it won't be seen as part of the public interface of the class.

It's also sometimes important to know details about how your particular class has implemented a given interface member.

On the other hand, it may be reasonable to give a very short description and direct people to the interface's documentation for more.

Jon Hanna