Re: static or not?



iamfractal@xxxxxxxxxxx wrote:
....
> If I use a singleton, then I can strip away an interface from this
> singleton, and have it register that interface in the Registry.
>
> If I use static methods, I cannot do this: static methods are not
> allowed to hide the instance methods of the interface.
>
> This is the major reason I use a singleton, instead of a class of
> static methods.
....

would expand on your thoughts here? instead of having, for example, a
"driver" class you'd have a singleton?


thanks,

Thufir

.



Relevant Pages

  • Re: Singleton
    ... hide the singleton class wholesale in the implementation section of the ... The interface is of course easily replaced with an abstract class: ... property MyFirstProperty: Integer read GetMyFirstProperty write ... procedure MyFirstProcedure; virtual; abstract; ...
    (borland.public.delphi.non-technical)
  • Re: Windows Service in VB
    ... Your service needs to expose an interface via .Net remoting. ... and register the public class as a well-known singleton. ... You also need to create a WinForms app that can be run by logged-in users. ... if your client app just wants to call methods on the service's remoted ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Singleton & Self := in constructor
    ... > I want to enforce singleton behavior in my TObject derived ... > The basic idea is that clients can call the Constructor any ... But it is much simpler to just use an interface ...
    (borland.public.delphi.language.objectpascal)
  • Re: Singleton
    ... I don't usually go to a string factory or a list factory to ... If you have an abstract DOM interface, for example, and the implementation ... To me it's very clear to go to the DomFactory or singleton ... As mentioned in my posting you unit test a class separate from the ...
    (comp.object)
  • Re: Singleton & Interfaces
    ... Basically, since both singletons expose the same interface, you ... public static class A: IMyInterface ... If you were truly implementing the singleton pattern, ...
    (microsoft.public.dotnet.languages.csharp)