/** * PetStore is a Factory that furnishes dogs that bark(). * @author Bob Futrelle * @version 1.0 7/1/2 */ class PetStore { int thresholdWeight; PetStore(int thresh) { thresholdWeight = thresh; } /** * This is the factory decision -- which dog to return. * Based on the weight. */ Dog getDog(int weight) { if(weight < thresholdWeight) return new LittleDog(); else return new BigDog(); } }