Builder pattern vs. config object

后端 未结 9 413
执笔经年
执笔经年 2021-01-31 08:40

The builder pattern is popular to create immutable objects, but there is some programming overhead to create a builder. So I wonder why not simply using a config object.

9条回答
  •  醉梦人生
    2021-01-31 09:28

    Have you considered using builder-builder?

    I do think the builder (with prefixes like "With") reads more natrually/fluently.

提交回复
热议问题