<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2017-02-07 13:51 GMT+01:00 Mattias Gaertner <span dir="ltr"><<a href="mailto:nc-gaertnma@netcologne.de" target="_blank">nc-gaertnma@netcologne.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-:598" class="gmail-a3s gmail-aXjCH gmail-m15a18a1a3f91d489">Why is that "more handy"? "static" does not have a Self. That<br>
is less handy, isn't it?<br></div></blockquote><div><br></div><div>by "handy" I mean usage of "class properties" instead of "static methods".</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-:598" class="gmail-a3s gmail-aXjCH gmail-m15a18a1a3f91d489">I can't follow you here. Are we still talking about why Delphi choose<br>
static instead of normal?<br></div></blockquote><div><br></div><div>"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:</div><div><br></div><div>===code begin===</div><div>var</div><div> Foo: TFooClass; // or Foo: TFoo</div><div>begin</div><div> WriteLn(Foo.F);</div><div>end;</div><div>===code end===<br></div><div><br></div><div>for regular "property" with "class methods" you need something like this:</div><div><br></div><div>===code begin===<br></div><div><div>var</div><div> Foo: TFooClass;</div><div>begin</div><div> Foo := TFoo;</div><div> WriteLn(Foo.E);</div><div>end;</div></div><div><div>===code end===<br></div></div><div><br></div><div>and for normal property:</div><div><br></div><div>===code begin===<br></div><div><div>var</div><div> Foo: TFoo;</div><div>begin</div><div> Foo := TFoo.Create;</div><div> WriteLn(Foo.D);</div><div>end;</div></div><div>===code end===<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-:598" class="gmail-a3s gmail-aXjCH gmail-m15a18a1a3f91d489">True.<br>
OTOH you loose some possibilities.</div></blockquote></div><br>True.<br><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>