The complexity of a type dictates which of three strategies you will use to initialize your immutable type.
一个类型的复杂性指示了你应该使用这三个策略里面的哪一个来初始化不可变类型。
To create an immutable type, you need to ensure that there are no holes that would allow clients to change your internal state.
为了创建一个不可变的类型,你需要保障没有任何漏洞允许客户修改你的内部状态。
To create an immutable type, you need to ensure that there are no holes that would allow clients to change your internal state.
为了创建一个不可变的类型,你需要保障没有任何漏洞允许客户修改你的内部状态。
应用推荐