XML Comments - Interfaces

  • Thread starter Thread starter colinjack
  • Start date Start date
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
 
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.
 
Back
Top