dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]TextWriter, 'standard' overriding (a little OT)


From: S11001001
Subject: Re: [DotGNU]TextWriter, 'standard' overriding (a little OT)
Date: Mon, 14 Jan 2002 15:22:43 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.7+) Gecko/20020106

Rhys Weatherley wrote:

S11001001 wrote:
2. Can you override methods AllTypes.xml doesn't say to? Can you NOT override
methods AllTypes.xml tells you to?


Whatever the AllTypes.xml file says, that's how we need to
declare it.  It's odd that "Write(char)" is not abstract, but
that's just the way it is.

I suppose that theoretically one could inherit "TextWriter"
and only use "Write(string)" on the inherited class.  It would
be annoying to have to also override "Write(char)", given
that it will never be used.



What I mean is, while Stream declares CanRead, CanWrite, Write(byte[], int, int), ... as abstract, these are not implemented in TextWriter, and nothing says to implement them in either TextWriter or StringWriter. However, StringWriter is a concrete class, and that means one has to implement these to create a valid concrete class. However, there is no mention of implementing these in AllTypes. There are all sorts of areas where this is not so...concrete, but is still important. For example, TextWriter should, according to the standard for Stream.CanRead, override BeginRead and related read functions to throw NotSupportedException.

Naturally, of course I would override the ones the standard tells you to, even if not technically necessary. But this was a sort of "do more" question, I believe necessary to have a working library.

Oh, I forgot a little protocol...I therefore announce that I am working on System.IO.StringWriter :)


--
We can use symlinks of course... syslogd would be a symlink to syslogp and
ftpd and ircd would be linked to ftpp and ircp... and of course the
point-to-point protocal paenguin.
        -- Kevin M. Bealer, commenting on the penguin Linux logo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]