title: Is FxCop's CollectionPropertiesShouldBeReadOnly rule incompatible with the spring framework?
body: <p>FxCop has the <a href="http://msdn.microsoft.com/en-ca/ms182327.aspx" rel="nofollow noreferrer">CollectionPropertiesShouldBeReadOnly rule</a> 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.</p>
  
  <p>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 collaborators, I have to expose some collection property to inject the collaborators into. I've looked through <a href="http://springframework.net/docs/1.1.2/reference/html/index.html" rel="nofollow noreferrer">the Spring documentation</a>, and I can't see any way to tell Spring to call the AddRange() method, am I missing something?</p>
  
  <p>For now, I'm going to exclude the warning with a note that it's necessary for Spring configuration.</p>
  
  <p><strong>Update:</strong> since I didn't get any nibbles here in the last two months, I posted the same question on the <a href="http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/1f9c8929-01eb-4388-89e8-8462b61975f1" rel="nofollow noreferrer">FxCop forum</a>.</p>