The builder pattern and a large number of mandatory parameters
问题 To date I use the following implementation of the builder pattern (as opposed to the implementation described here): public class Widget { public static class Builder { public Builder(String name, double price) { ... } public Widget build() { ... } public Builder manufacturer(String value) { ... } public Builder serialNumber(String value) { ... } public Builder model(String value) { ... } } private Widget(Builder builder) { ... } } This works well for most situations I've encountered where I