Re: Singleton



2. A class var is a clean OOP mechanism and it's not .NET specific
either. C++ has had class vars for ages now and I always missed them
in Delphi 7.

Hey, I'm not saying class vars themselves are illegitimate. Whether
they make for 'a clean OOP mechanism' is another matter however (see my
reply to your other post)!

You could even live without ever creating an instance of the class,
since the class itself can have data (using class vars).

Well, if that were possible, using a records-with-methods approach
rather than a class would be more appropriate IMO, since otherwise, you
would be 'misusing' Delphi's 'class' idiom in a manner almost as much
as writeable typed consts 'misuse' the word 'const' - for, isn't the
first thing a person learns about objects in Delphi is that they are
always created on the heap, and so, have to be explicitly instantiated
before being used?
.



Relevant Pages

  • Re: Kylix is dead?
    ... Would an up-to-date Linux offering make Delphi stronger? ... have generics, and class vars, and class constructors, and reflection, and ... If you really need to be supporting those other platforms, ...
    (borland.public.delphi.non-technical)
  • Re: Why no language improvements?
    ... +AD4- Class vars ... +AD4- Class constructors ... How anyone can argue that Delphi isn't evolving and adding language ...
    (borland.public.delphi.non-technical)