package builder;
import abstractFactory.rusFleet.Kamaz;
import abstractFactory.rusFleet.Vaz2110;
public class Client {
private static ProductionLine line;
public static void main
(String[] args
) { line = new ProductionLine();
CarBuilder vazBuilder = new Vaz2110Builder();
Vaz2110 vaz = (Vaz2110) line.MakeCar(vazBuilder);
// Business logic with vaz var...
Kamaz kamaz = (Kamaz) line.MakeCar(new KamazBuilder());
// Business logic with kamaz var...
Vaz2110 vaz4Dakar = (Vaz2110) line.MakeSportCar(vazBuilder);
Kamaz kamaz4Dakar = (Kamaz) line.MakeSportCar(new KamazBuilder());
System.
out.
println(vaz4Dakar +
", " + kamaz4Dakar
);
RotatingPartCountBuilder counter = new RotatingPartCountBuilder(100);
// Part number of usial car
line.MakeCar(counter);
int partNum = counter.getCount();
// Part number of usual car
counter.Reset(200);
line.MakeSportCar(counter);
int partNum2 = counter.getCount();
System.
out.
println("in car " + partNum +
" rotating parts, " +
"but in sports car: " + partNum2);
// other logic..
}
}