[fpc-pascal] Implementing Factory Method with Pascal
serge at arbinada.com
Sat Nov 28 14:09:11 CET 2015
What is an explanation why the first code is not good but the second one
At least, the first code is three times as shorter and clear.
Second code seems to be taken from Delphi 7 where the first one doesn't
On 28/11/2015 12:00, fpc-pascal-request at lists.freepascal.org wrote:
>> >if Animal is IBarkable then (Animal as IBarkable).Bark;
> This is not good usage of Interfaces. Use the interface variable instead.
> intf: IBarkable
> if Supports(Animal, IBarbable, intf) then
> // you can continue here using intf further without casting
More information about the fpc-pascal