// Constructor public AnimalWorld(ContinentFactory factory) { carnivore = factory.CreateCarnivore(); herbivore = factory.CreateHerbivore(); }
// Constructor public AnimalWorld(RealWorldAbstractFactory abstractFactory) { _carnivore = abstractFactory.CreateCarnivore(); _herbivore = abstractFactory.CreateHerbivore(); }