Click here to Skip to main content
15,913,315 members
Home / Discussions / C#
   

C#

 
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 
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 
leppie wrote:
You would have to instanciated an IChalk object to use an IChalk object. Remember the type of the IChalk object will not be IChalk, it will be the actuall type of the class

His point (and a good one) is that he shouldn't have needed to instantiate any object that implements IChalk in order to call Deserialize, by itself Deserialize doesn't need any state at all to operate (since it only creates a new instance of that object and returns a reference as the interface).

I think the class factory pattern would apply well here, have a class/interface that deserializes and creates new instances of objects implementing IChalk.

interface IChalkFactory
{
  IChalk Deserialize();
  IChalk Create();
  // etc
  void Serialize(IChalk);
}
James
"And we are all men; apart from the females." - Colin Davies
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 
GeneralRe: IDE hangs up on executing ! Pin
EdgarBM20-Aug-02 23:04
EdgarBM20-Aug-02 23:04 
GeneralCombobox and SetItemData Pin
Michael P Butler19-Aug-02 23:51
Michael P Butler19-Aug-02 23:51 
GeneralRe: Combobox and SetItemData Pin
Nnamdi Onyeyiri20-Aug-02 0:02
Nnamdi Onyeyiri20-Aug-02 0:02 
GeneralRe: Combobox and SetItemData Pin
Michael P Butler20-Aug-02 0:25
Michael P Butler20-Aug-02 0:25 
GeneralRe: Combobox and SetItemData Pin
Nnamdi Onyeyiri20-Aug-02 0:53
Nnamdi Onyeyiri20-Aug-02 0:53 

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.