Click here to Skip to main content
16,008,750 members
Home / Discussions / C#
   

C#

 
GeneralRe: SAS Dataset Pin
Ray Cassick20-Aug-02 9:20
Ray Cassick20-Aug-02 9:20 
GeneralRe: SAS Dataset Pin
Jassim Rahma23-Aug-02 9:42
Jassim Rahma23-Aug-02 9:42 
GeneralInsert a graphics in an other graphics Pin
troz20-Aug-02 5:47
troz20-Aug-02 5:47 
GeneralRe: Insert a graphics in an other graphics Pin
James T. Johnson20-Aug-02 7:59
James T. Johnson20-Aug-02 7:59 
GeneralRe: Insert a graphics in an other graphics Pin
troz20-Aug-02 21:32
troz20-Aug-02 21:32 
GeneralInterfaces and Static methods - How could they!!! Pin
Ryan Cromwell20-Aug-02 4:11
Ryan Cromwell20-Aug-02 4:11 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
leppie20-Aug-02 4:23
leppie20-Aug-02 4:23 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
Ryan Cromwell20-Aug-02 4:43
Ryan Cromwell20-Aug-02 4:43 
What do you do leppie? You have amazing response times - not that I'm complaining. Anyways, I believe (not a language historian or anything) that is makes complete sense. For instance, lets say we have the following interface:

IChalk {
Color color { get; }
void Break();

string SerializeXml();
static IChalk Deserialize( string Xml ); //Cannot actually do the static thang.
}

class GreenChalk : IChalk {
Color IChalk.color { get { return Color.Red; } }
void Break() { throw( new Exception("Damn it!!!") ); }

string IChalk.SerializeXml() {
XmlSerializer sr = new XmlSerializer( this.GetType );
//blah blah
}
static IChalk IChalk.Deserialize( string xml ){
GreenChalk gc = new GreenChalk();
//blah blah

return gc;
}
}


I hate using specific examples for explainations but it'll save on length and confusion.

Now you could just make it deserialize to the instance and remove the need for the static member, but I believe it is more consistant this way; once you instanciate the implementing class you HAVE an IChalk, Deserialize in escence creates another one. So to Deserialize I have to create two versions.

You do point out a good idea that could mirror that though. I could use an abstract class with the Serialization methods in them and do that I guess, but it is definitly a hack in my mind. Unless someone else (or you) can explain why it isn't.
GeneralRe: Interfaces and Static methods - How could they!!! Pin
Philip Fitzsimons20-Aug-02 4:48
Philip Fitzsimons20-Aug-02 4:48 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
leppie20-Aug-02 5:13
leppie20-Aug-02 5:13 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
Ryan Cromwell20-Aug-02 7:08
Ryan Cromwell20-Aug-02 7:08 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
leppie20-Aug-02 7:29
leppie20-Aug-02 7:29 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
James T. Johnson20-Aug-02 7:38
James T. Johnson20-Aug-02 7:38 
GeneralRe: Interfaces and Static methods - How could they!!! Pin
Ryan Cromwell20-Aug-02 7:52
Ryan Cromwell20-Aug-02 7:52 
GeneralIDE hangs up on executing ! Pin
EdgarBM20-Aug-02 0:16
EdgarBM20-Aug-02 0:16 
GeneralRe: IDE hangs up on executing ! Pin
Nnamdi Onyeyiri20-Aug-02 0:52
Nnamdi Onyeyiri20-Aug-02 0:52 
GeneralRe: IDE hangs up on executing ! Pin
James T. Johnson20-Aug-02 5:44
James T. Johnson20-Aug-02 5:44 
GeneralRe: IDE hangs up on executing ! Pin
Nnamdi Onyeyiri20-Aug-02 6:12
Nnamdi Onyeyiri20-Aug-02 6:12 
GeneralRe: IDE hangs up on executing ! Pin
Stephane Rodriguez.20-Aug-02 1:22
Stephane Rodriguez.20-Aug-02 1:22 
GeneralRe: IDE hangs up on executing ! Pin
EdgarBM20-Aug-02 1:26
EdgarBM20-Aug-02 1:26 
GeneralRe: IDE hangs up on executing ! Pin
Nnamdi Onyeyiri20-Aug-02 3:16
Nnamdi Onyeyiri20-Aug-02 3:16 
GeneralRe: IDE hangs up on executing ! Pin
leppie20-Aug-02 3:33
leppie20-Aug-02 3:33 
GeneralRe: IDE hangs up on executing ! Pin
Anonymous20-Aug-02 3:39
Anonymous20-Aug-02 3:39 
GeneralRe: IDE hangs up on executing ! Pin
Anonymous20-Aug-02 4:15
Anonymous20-Aug-02 4:15 
GeneralRe: IDE hangs up on executing ! Pin
James T. Johnson20-Aug-02 5:42
James T. Johnson20-Aug-02 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.