2017-02-07 13:51 GMT+01:00 Mattias Gaertner :
Why is that "more handy"? "static" does not have a Self. That
is less handy, isn't it?
by "handy" I mean usage of "class properties" instead of "static methods".
I can't follow you here. Are we still talking about why Delphi choose
static instead of normal?
"class property" is used for code where class instance (nor assign to meta class) is not needed. Some variance/idea of singleton pattern. TFoo might be used as namespace:
===code begin===
var
Foo: TFooClass; // or Foo: TFoo
begin
WriteLn(Foo.F);
end;
===code end===
for regular "property" with "class methods" you need something like this:
===code begin===
var
Foo: TFooClass;
begin
Foo := TFoo;
WriteLn(Foo.E);
end;
===code end===
and for normal property:
===code begin===
var
Foo: TFoo;
begin
Foo := TFoo.Create;
WriteLn(Foo.D);
end;
===code end===
True.
OTOH you loose some possibilities.
True.
Best regards,
Maciej Izak