When providing multiple overloads of the same method, I often have to repeat the description of the method, which violates DRY and increases maintenance cost:
/// <summary>
/// Frobnicates all foos read from the given reader. Frobnication is a
/// process where ...[lots of text]...
/// </summary>
/// <param name="hasBar">[Description of hasBar]</param>
void FrobnicateFoo(TextReader reader, bool hasBar)
{
...
}
/// <summary>
/// Frobnicates all foos read from the given file. Frobnication is a
/// process where ...[same lots of text]...
/// </summary>
/// <param name="hasBar">[Same description of hasBar]</param>
void FrobnicateFoo(String path, bool hasBar)
{
...
}
This problem gets worse if multiple parameters with the same purpose are repeated ("hasBar" is given as an example).
One "workaround" I found is to "reference" the other documentation:
/// <summary>
/// Frobnicates all foos read from the given reader. Frobnication is a
/// process where ...[lots of text]...
/// </summary>
/// <param name="hasBar">[Description of hasBar]</param>
void FrobnicateFoo(TextReader reader, bool hasBar)
{
...
}
/// <summary>
/// Convenience method which opens the file with a UTF-8 encoding and then
/// frobnicates all foos, see FrobnicateFoo(TextReader).
/// </summary>
void FrobnicateFoo(String path, bool hasBar)
{
...
}
Obviously, that's less convenient for the user of the library.
Is there some built-in mechanism (or smart strategy) that I can use to avoid duplication and make life easy for the users of my methods? I am mainly concerned about IntelliSense, not generated HTML documentation.