471,348 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Re-using XML comments

It's a bit of a PITA to duplicate XML comments in such a scenario as where
you want to give a class method implementing an interface method exactly the
same documentation (or part thereof) as the interface method, and keep them
in synch.

Are there any documentation tools, possibly using custom tags, available
which can support such a
feature?

Feb 1 '06 #1
6 1496
Clive,

I agree with you 100% that it is a pain to do this. Unfortunately,
there is nothing like a "reference" to other XML comments that I am aware
of. You would need a third party tool to handle all of this

This is also desirable for overloaded methods where the description is
the same, but the parameters differ slightly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:uz**************@TK2MSFTNGP11.phx.gbl...
It's a bit of a PITA to duplicate XML comments in such a scenario as where
you want to give a class method implementing an interface method exactly
the
same documentation (or part thereof) as the interface method, and keep
them in synch.

Are there any documentation tools, possibly using custom tags, available
which can support such a
feature?

Feb 1 '06 #2
I guess it must be possible using NDoc's extensibility features, but that
would be a project in itself (especially as I'm far from an XSLT expert).

Let's hope for improved support in C# 3.0...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uH**************@TK2MSFTNGP15.phx.gbl...
Clive,

I agree with you 100% that it is a pain to do this. Unfortunately,
there is nothing like a "reference" to other XML comments that I am aware
of. You would need a third party tool to handle all of this

This is also desirable for overloaded methods where the description is
the same, but the parameters differ slightly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:uz**************@TK2MSFTNGP11.phx.gbl...
It's a bit of a PITA to duplicate XML comments in such a scenario as
where
you want to give a class method implementing an interface method exactly
the
same documentation (or part thereof) as the interface method, and keep
them in synch.

Are there any documentation tools, possibly using custom tags, available
which can support such a
feature?


Feb 1 '06 #3
Clive,

Fortunately, there is a way for your voice to be heard:

http://lab.msdn.microsoft.com/produc...k/default.aspx

Put in a recommendation (or support an existing one that suits your
needs), and it will be entered into their internal system.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:eU**************@tk2msftngp13.phx.gbl...
I guess it must be possible using NDoc's extensibility features, but that
would be a project in itself (especially as I'm far from an XSLT expert).

Let's hope for improved support in C# 3.0...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uH**************@TK2MSFTNGP15.phx.gbl...
Clive,

I agree with you 100% that it is a pain to do this. Unfortunately,
there is nothing like a "reference" to other XML comments that I am aware
of. You would need a third party tool to handle all of this

This is also desirable for overloaded methods where the description is
the same, but the parameters differ slightly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:uz**************@TK2MSFTNGP11.phx.gbl...
It's a bit of a PITA to duplicate XML comments in such a scenario as
where
you want to give a class method implementing an interface method exactly
the
same documentation (or part thereof) as the interface method, and keep
them in synch.

Are there any documentation tools, possibly using custom tags, available
which can support such a
feature?



Feb 1 '06 #4
Use the <include> tag to include external file comments. This way you can
include the same comments for multiple items.

See:
http://msdn.microsoft.com/library/de...lrfinclude.asp
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:eU**************@tk2msftngp13.phx.gbl...
I guess it must be possible using NDoc's extensibility features, but that
would be a project in itself (especially as I'm far from an XSLT expert).

Let's hope for improved support in C# 3.0...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uH**************@TK2MSFTNGP15.phx.gbl...
Clive,

I agree with you 100% that it is a pain to do this. Unfortunately,
there is nothing like a "reference" to other XML comments that I am aware
of. You would need a third party tool to handle all of this

This is also desirable for overloaded methods where the description is
the same, but the parameters differ slightly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:uz**************@TK2MSFTNGP11.phx.gbl...
It's a bit of a PITA to duplicate XML comments in such a scenario as
where
you want to give a class method implementing an interface method exactly
the
same documentation (or part thereof) as the interface method, and keep
them in synch.

Are there any documentation tools, possibly using custom tags, available
which can support such a
feature?



Feb 1 '06 #5
The problem with <include> and with any scheme for referencing comments
somewhere else is that they are far more likely to become out of step with
the code than those actually with the method for 2 reasons:

1) Nobody looking at the method will bother checking that the comments are
correct if they are somewhere else.
2) Nobody changing the "primary" comment will ever look for all the places
in which it is used to ensure that it still holds.

I think copy and paste is probably the best of a bad set of options.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:u3**************@TK2MSFTNGP15.phx.gbl...
Use the <include> tag to include external file comments. This way you can
include the same comments for multiple items.

See:
http://msdn.microsoft.com/library/de...lrfinclude.asp
--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:eU**************@tk2msftngp13.phx.gbl...
I guess it must be possible using NDoc's extensibility features, but that
would be a project in itself (especially as I'm far from an XSLT expert).

Let's hope for improved support in C# 3.0...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:uH**************@TK2MSFTNGP15.phx.gbl...
Clive,

I agree with you 100% that it is a pain to do this. Unfortunately,
there is nothing like a "reference" to other XML comments that I am
aware of. You would need a third party tool to handle all of this

This is also desirable for overloaded methods where the description
is the same, but the parameters differ slightly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:uz**************@TK2MSFTNGP11.phx.gbl...
It's a bit of a PITA to duplicate XML comments in such a scenario as
where
you want to give a class method implementing an interface method
exactly the
same documentation (or part thereof) as the interface method, and keep
them in synch.

Are there any documentation tools, possibly using custom tags,
available which can support such a
feature?




Feb 1 '06 #6
This particular scenario wasn't mentioned, but someone did ask Anders
Hejlsberg at PDC'05 whether there shouldn't be some way to share
comments between overloads. Anders thought it was a good idea, although
I don't know that it was recorded anywhere.

So, if you put in a suggestion to that effect, it's likely to get a
favourable reception.

Feb 1 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.