Re: Singleton



I thought about that a little longer, maybe the Delphi language should add
support for a new "singleton" keyword like this:

type
MySingleton = singleton
strice private
FMyFirstProperty: Integer;
public
property MyFirstProperty: Integer read FMyFirstProperty write
FMyFirstProperty;
procedure MyFirstProcedure;
end;


Delphi doesn't need a singleton class type, because
it is possible to create standalone non-object oriented
procedures and functions within a unit.
Surely a singleton class just emulates a set of
standalone functions?

cheers,

Chris


.



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: Singleton
    ... support for a new "singleton" keyword like this: ... property MyFirstProperty: Integer read FMyFirstProperty write ... it's not even the OOP just for the sake of OOP ... Earth = singleton ...
    (borland.public.delphi.non-technical)