I have recently learned this builder pattern a little different... So this confuses me a bit.
My builder pattern went something like:
Vehicle myVehicle = new Vehicle.Builder().color("blue")
.doors(4).horsepower(140).make("make")
.model("model").price(122).type("type").Build();
So to me the crux was the fact that you can 'compose' a product via one build action.
Build methods are not exactly the builder pattern. However, implicitly is the same. Your code could be in the Director participant. You could use a public static Builder class with or without an interface and the build result is the Product, in your case Vehicle.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have recently learned this builder pattern a little different... So this confuses me a bit.
My builder pattern went something like:
Vehicle myVehicle = new Vehicle.Builder().color("blue")
.doors(4).horsepower(140).make("make")
.model("model").price(122).type("type").Build();
So to me the crux was the fact that you can 'compose' a product via one build action.
Build methods are not exactly the builder pattern. However, implicitly is the same. Your code could be in the Director participant. You could use a public static Builder class with or without an interface and the build result is the Product, in your case Vehicle.