title: When is it ok to change object state (for instance initialization) on property getter access?
body: <p>(except for proxy setup!)</p>
  
  <p>I spent some time writing a question here regarding a better pattern for a problem I had - of a class that performed some conditional initialization on almost every property getter, since the initialization in the base class relied on data from the inheriting classes that wasn't available on construction.</p>
  
  <p>While writing the question I came to the conclusion it would be better practice to initialize on inheritor construction. This would require every inheriting class to call the parents initialization method, but I think it's better, because:</p>
  
  <ol>
  <li>I don't have to remember to initialize in the base class on every new property getter/setter.</li>
  <li>I don't accidentally trigger the initialization while debugging (<a href="https://stackoverflow.com/questions/1761668/how-to-avoid-triggering-properties-while-debugging">see my question here</a>)</li>
  </ol>
  
  <p>If you ever had code that changes state in a property getter, do you think it's absolutely justified? Can you give an example for such a case? (Or even describe the pattern?)</p>
  
  <p>I could only think of proxy access, where you don't want to perform initialization until property access...</p>
  
  <hr>
  
  <p>Somebody suggested that I initialize using a factory/static method - that's actually a good idea (when the construction is simple, a bit harder when it's not uniform across inheriting classes), but the answer was deleted before I had a chance to submit my reply. too bad.</p>