title: Singleton Data Access Layers
body: <p>In our data access layer at work we have this standard implementation where the class is accessed through a singleton public property which looks something like this:</p>
  
  <pre><code>public static CustomerController Instance
          {
              get 
              {
                  lock(singletonLock)
                  {
                      if( _instance == null )
                      {
                          _instance = new CustomerController();  
                      }
                      return _instance;
                  }
              }
          }
  </code></pre>
  
  <p>now, I get what the code is doing, but I was wondering why you would do this over just creating an instance of the class each time it is used?</p>