HighTechTalks DotNet Forums  

What prevents "static interface" and "static inheritance" - SVT

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss What prevents "static interface" and "static inheritance" - SVT in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Loy
 
Posts: n/a

Default What prevents "static interface" and "static inheritance" - SVT - 08-17-2006 , 04:32 AM






Many times I wish to define a static method interface to a hierarchy of
classes

It seems to me that if there was static-virtual-table [SVT] per class,
like there is virtual-table per class-instance - it would enable these
features

My questions are:
1. What are the barriers that prevent dot net from supporting this
functionality?
2. Am I wrong in my suggestion for SVT?, what am I missing?
3. I heard that there are languages that support static-contract etc -
how is it implemented there?

Loy


Reply With Quote
  #2  
Old   
Alan Pretre
 
Posts: n/a

Default Re: What prevents "static interface" and "static inheritance" - SVT - 08-17-2006 , 11:28 AM






"Loy" <l.oyolox (AT) gmail (DOT) com> wrote

Quote:
Many times I wish to define a static method interface to a hierarchy of
classes
There are quite a few discussions about this over in the C# n.g. Take a
look at these:
http://tinyurl.com/oxtb3

If none of these answer your questions, then I would suggest that you repost
to m.p.d.languages.csharp.

-- Alan




Reply With Quote
  #3  
Old   
Loy
 
Posts: n/a

Default Re: What prevents "static interface" and "static inheritance" - SVT - 08-20-2006 , 07:13 AM



Hi Alan

Thanks for your response (and packing it into the tinyurl)
There are many talks about this issue but finding the answer for the
design-decisions of why not having static inheritance and contracts
(interface declaration) is like finding a needle in a hay stack

According to the discussion - the clr DOES support it, but not csharp

The question is somewhat academic - why?

For example:
I want to override the Console.WriteLine(string) without rewriting
the whole class
My app should get something like static ref to a class that
implements IConsole or inherits from Console ...
But Console methods are static...
Either the language designer deprive statics (and thus Console class
should be a singleton rather than static) or it should support OOD for
statics.

I must be missing something (as brighter people designed this) - what
is it that I miss?

Anyway

Thanks a lot for your pointer

Loy




Alan Pretre wrote:
Quote:
"Loy" <l.oyolox (AT) gmail (DOT) com> wrote in message
news:1155803561.460559.57600 (AT) 75g2000cwc (DOT) googlegroups.com...
Many times I wish to define a static method interface to a hierarchy of
classes

There are quite a few discussions about this over in the C# n.g. Take a
look at these:
http://tinyurl.com/oxtb3

If none of these answer your questions, then I would suggest that you repost
to m.p.d.languages.csharp.

-- Alan


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.