Is FxCop's CollectionPropertiesShouldBeReadOnly rule incompatible with the spring framework?
- 阅读更多 关于 Is FxCop's CollectionPropertiesShouldBeReadOnly rule incompatible with the spring framework?
问题 FxCop has the CollectionPropertiesShouldBeReadOnly rule that complains if your class has some kind of collection property that clients can set. Instead, it suggests making the property read-only and supplying a Clear() method and Add() or AddRange() methods for changing the contents of the collection. I agree that makes for a cleaner and more controlled interface, but I'm struggling to make that interface work with the Spring framework. If I want to configure an object with a collection of