擅长:python、mysql、java
<p>理想情况下,构造函数不应调用方法:<a href="http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/" rel="nofollow">a constructor should not do real work</a>。在</p>
<p>如果属性的数量增长过度,您应该重构类,例如使用<a href="http://www.refactoring.com/catalog/extractClass.html" rel="nofollow">Extract Class</a>将类分成几个类,从而尊重<a href="http://en.wikipedia.org/wiki/Single_responsibility_principle" rel="nofollow">single responsibility principle</a>。在</p>