JavaWorld on OO: Getters/Setters vs Builder

后端 未结 4 1513
萌比男神i
萌比男神i 2020-12-28 19:31

Background:

I found this article on JavaWorld, where Allen Holub explains an alternative to Getters/Setters that maintains the principle that the implementation of

4条回答
  •  情书的邮戳
    2020-12-28 19:54

    You can implement Builders is a more concise manner. ;) I have often found writing Builders by hand tedious and error prone.

    It can work well if you have a data model which generates your Data Value objects and their Builders (and marshallers). In that case I believe using Builders is worth it.

提交回复
热议问题