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