On 27/11/15 23:21, luciano de souza wrote:
...

But, if this not works, how to implement the Factory Method in Freepascal?
What about:

var
  animal: TDog;
BEGIN
  animal := TAnimalFactory.create(atDog);
  try
    if animal is TDog then
      TDog(animal).bark;
  finally
    animal.free;
  end;
END.

Stephano
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to