Hi Chris,
The problem is that c# (I don't know about CLR) doesn't have support of the
full conception of meta-classes.
It support this idea partially. When we declare a class we actually decalre
two types: one is the given class and the second is the meta-class for the
given class. The meta-class' members are all members declared as static as
well as all construcotrs. The one single object of this meta-class type is
created when the class gets loaded (static constractors is executed which is
evidence of existance of instance of the meta-class) and the name of this
objects is the name of the class itself.
So, calling a static method ClassA.X() should be considered as calling the
method X of the singleton instance of the meta-class of the ClassA.
Creating objects of given class obj = new ClassA(...) can considered as a
short-cut for obj = ClassA.CreateInstance(....) where CreateInstance methods
are all constructors of a class.
What we miss here is a type *refrence to a meta-class*. Since c# doesn't
support defining variables of type *reference to a meta-class* having
virtual static methods, static interfaces, etc doesn't make any sense.
For instance Delphi is a language, which supports meta-class conception. In
Delphi we can declare variables of type *reference to a meta-class* that's
why we have virtual constructors for example.
So, I think that this is more conceptual rather than technical issue. I
believe that CLR has the whole inforamtion and structures internaly to make
having virtual constructors, virtual satic members, static interfaces, etc
posible.
B\rgds
100
----- Original Message -----
From: "Chris Capel" <
[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
Sent: Thursday, July 24, 2003 3:37 PM
Subject: Re: implementing interfaces with static methods