[fpc-pascal] Implementing Factory Method with Pascal
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Nov 27 22:30:52 CET 2015
One solution:
var
animal: TDog;
BEGIN
animal := TAnimalFactory.create(atDog) as TDog;
try
animal.bark;
finally
animal.free;
end;
END.
Mattias
More information about the fpc-pascal
mailing list