In this example, updating the value of simple attributes, the performance impact would not be significant.
该例中仅仅更新简单的属性值,对性能的影响不是很明显。
To avoid this problem, complex attributes should be initialized in the constructor; however, this is not necessary for simple attributes such as strings, booleans, and so on.
为了避免这个问题,应当在构造函数中初始化复杂属性;然而,对于字符串、布尔值等简单属性则不需要这样做。
应用推荐