XML Comments - Interfaces

C

colinjack

Hi Guys,

I'm looking for a few opinions on what to put in XML Comments on
interfaces.

Firstly what do you think of including an exception element in the XML
comments for an interface method:

public interface IWhatever
{
# region Methods

/// <summary>
/// </summary>
/// <exception cref="ArgumentNullException">exception>
void MyMethod();

I quite like it, I know that we cant actually be sure that any classes
implement the interface will raise the exception but I like documenting
it in the interface anyway. Any thoughts?

Also in some cases when I'm implementing a class that supports the
interface above my comment for the MyMethod implementation would be
something like:

/// <summary>
/// Implements IWhatever.MyMethod.
/// </summary>
void MyMethod();

I've seen lots of code that does this and I quite like it but I've
never been sure what other people thought? Obviously this doesnt always
apply.

Ta,

Colin
 
C

colinjack

Oh and I should say, I realise the second point is a bit of a silly one
from the perspective of produces documents from the XML because that
already shows what interface method is being implemented.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top