4

In the Builder pattern, do all the concrete builder return the same type of object (with each object having different attributes) OR do they builders each return a sublcass of some other class?

For example, in a car builder, would the builders all return car objects or would builders return objects of types such as "luxurycar", "economyCar", "sportsCar" which all inherit from car? If the latter case is correct, then how does the builder add unique attributes to the subclass objects that it creates?

4

2 に答える 2