<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 17, 2015 at 3:09 AM, Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><p>Am 17.07.2015 08:06 schrieb "Graeme Geldenhuys" <<a href="mailto:mailinglists@geldenhuys.co.uk" target="_blank">mailinglists@geldenhuys.co.uk</a>>:<br>
><br>
> On 2015-07-17 03:34, silvioprog wrote:<br>
> > TPersonDao = class(TObject)<br>
> > public<br>
> >   procedure Save(APerson: TObject);<br>
> > end;<br>
><br>
> Simply change that to the following:<br>
><br>
> TPersonDao = class(TObject)<br>
> public<br>
>   procedure Save(APerson: TPerson);<br>
> end;<br>
><br>
> and you could have compile time validation too. Using TObject as the<br>
> parameter type is just too generic (excuse the pun). ;-)</p>
</span><p>I agree with Graeme here as I thought the same. But maybe the example was too simplified and didn't show real reasons for the use of generics?</p>
<p>Regards,<br>
Sven</p></blockquote></div><div>Yes. Could you send a more nice example explaining some useful reasons of generics (freepascal\tests\tbf folder)? I think that it could be very helpful to many programmers. =)</div><div><br></div>-- <br><div class="gmail_signature">Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>