3 ms·
I read over the article. I don't exactly understand his desires to keep a developer from converting an instance of a superclass into an instance of a sub-class
by sukuriant 17y ago
I read over the article. I don't exactly understand his desires to keep a developer from converting an instance of a superclass into an instance of a sub-class (presumably to implement the specific methods). Maybe I don't understand his paradigm properly, and that situation can never happen (there was mention of no virtual methods, either. Perhaps that has something to do with the above situation never actually existing), but why would this be an advantage.
Furthermore, can't that very restriction be circumvented by making it a two-step procedure instead of 1?
Eg:
Any a = (Any)someObject;
DerivedObject b = (a as DerivedObject);