title: What to is best to initialize in a class constructor?
body: <p>I have a design question about constructors. After watching this <a href="http://www.youtube.com/watch?v=RlfLCWKxHJ0" rel="nofollow">video</a> from google about "The Clean Code Talks", he talked about the importance of the initializing classes and more in the constructor, and for better testing options. In my code for example i have a wcf service hosted on the <code>iis</code> in the service svc contructor we initialize the entire service.    </p>
  
  <pre><code> BService()
      {
          if (!m_DAL.Initilaze())
          {
              throw new Exception("Due to problems in the initialization B2BService is down");
          }
  
          m_sBadTransactionDir = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "BadTransaction";
  
          _address1 = new EndpointAddress(System.Configuration.ConfigurationManager.AppSettings["1Address"]);
          _address2 = new EndpointAddress(System.Configuration.ConfigurationManager.AppSettings["2Address"]);
          _address3 = new EndpointAddress(System.Configuration.ConfigurationManager.AppSettings["3Address"]);
          _address4 = new EndpointAddress(System.Configuration.ConfigurationManager.AppSettings["4Address"]);
  
          LoadSitesFromAdaptors();
  
          double interval1= Convert.ToDouble(System.Configuration.ConfigurationManager.AppSettings["interval1"]);
          m_sentTransactionTimer.Interval = interval1;
          m_sentTransactionTimer.Elapsed += Foo1;
          m_sentTransactionTimer.Start();
  
          double interval2 = Convert.ToDouble(System.Configuration.ConfigurationManager.AppSettings["interval2"]);
          m_checkStatusTimer.Interval = interval2 ;
          m_checkStatusTimer.Elapsed += Foo2;
          m_checkStatusTimer.Start();
  
          double interval3= Convert.ToDouble(System.Configuration.ConfigurationManager.AppSettings["interval3"]);
          m_adaptorsTimer.Interval = interval3;
          m_adaptorsTimer.Elapsed += Foo3;
          m_adaptorsTimer.Start();
  
  .... and some more initialization code here
  
  
          Logger.Instance.Write("***************  Service is Up  ****************", "INFO");
      }
  </code></pre>
  
  <p>Do you guys know of better ways to initialize big classes ? make it easier to test 
  and generally your opinion on the matter ? </p>