Design by contract avoids extra code and improves performance, as long as all clients of a class abide by the contract.
契约式设计避免了额外的编码并提高了性能,只要所有的客户都遵守契约。
2
This should be considered an extraperformance bonus rather than an incentive to convert attributes to elements, especially when data modeling considerations actually call for elements.