Content deleted Content added
Normana400 (talk | contribs) →Critics: adding commentary that this page is co-mingling 2 unrelated patterns |
Normana400 (talk | contribs) |
||
Line 176:
The java example is not the "GOF builder pattern". It's the "java builder pattern". They are significantly different unrelated patterns. The java builder pattern is a wrapper for collecting settings used to eventually construct an object when you've collected enough. ie: new CarBuilder().wheels(4).paint("blue").type("sedan").interior("leather").makeItSo(); You can use it to with a protected constructor so that all entities that want to build an object have to use the builder to do it. You can also use this java builder pattern in scala to build immutable objects. So that is the java builder pattern. Theres no director class for this type of builder. When the page is talking about the builder pattern being a wrapper around a constructor, its talking about this pattern.
The GOF builder pattern is not like this at all. Whereas the java builder pattern is more about convenient sentence like construction, the GOF builder is more about building a complex/compound object with encapsulated builders that no nothing about each other.
with that in mind, I think this page should be split into 2 sections, one for the GOF pattern and one for the Java build pattern
|