By piccoloprincipe
via giorgiosironi.blogspot.com
Published: Nov 07 2009 / 00:15
One of the pillars of design for testability, which is listed also in the Google guide for code reviewers, is to have constructors that do not contain logic or method calls. I will explain the reasons behind this choice with an example, but let me say that to reduce dependencies it is natural for a class to avoid making assumptions on the external environment, performing things like creating new objects. Separating the business responsibility of a class from the one of wiring itself to other objects is necessary.
Add your comment
Voters For This Link (11)
-
aclarke -
henrycow -
martinig -
johnfarden -
mswatcher -
olagato.myopenid.com -
gromitt -
Marwy -
MCII -
bhavikdbavishi -
Restinest


