[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DotGNU]TextWriter, 'standard' overriding (a little OT)
From: |
S11001001 |
Subject: |
[DotGNU]TextWriter, 'standard' overriding (a little OT) |
Date: |
Sun, 13 Jan 2002 22:20:51 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.7+) Gecko/20020106 |
1. What's with the recursive calls in System.IO.TextWriter?
The Hierarchy of Write(?):
Formatted section, (char), (bool), (double), (Decimal), (float), (int), (uint),
(ulong), (Object) depend on Write(string)
(char[]) depends on (char[], int, int)
(char[], int, int) depends on (char)
(String) depends on (char[])
So you can see, any Write call will eventually result in a recursive set,
(char)->(String)->(char[])->(char[], int, int)->repeat.
Now, I believe this is a perfect example of the poor object design in the
proposed BCL standard. I believe it can be broken (or fixed, either works) by
redefining String, char[], or (char[], int, int) as abstract. Now that I have
answered my own question, Thus follows,
2. Can you override methods AllTypes.xml doesn't say to? Can you NOT override
methods AllTypes.xml tells you to?
--
Dijkstra probably hates me.
-- Linus Torvalds, in kernel/sched.c
- [DotGNU]TextWriter, 'standard' overriding (a little OT),
S11001001 <=