/** Factory for each of the types of bars that will be needed */
public class BarFactory {

  private ConcreteSineBar[] bars;

  public BarFactory() {

    // Create only the 8 bars we will need
    bars = new ConcreteSineBar[8];

    for (int i=0 ; i<8 ; i++) {
      bars[i] = new ConcreteSineBar(i);
    }

  }