title: How to create a one to one singleton relation
body: <p>I've got two singleton in my application and here is my problem:
  Each one of them need each other so i can't build any of the two because i'll get a stackOverflowError. How to get over it ? </p>
  
  <pre><code>public class ApplicationService {
  
      private ApplicationDao applicationDao;
      private DerogationService derogationService;
      private LogService logService;
      private static ApplicationService applicationServiceInstance;
  
      private ApplicationService() 
      {
          applicationDao = ApplicationDao.getInstance();
          derogationService = DerogationService.getInstance();
          logService = LogService.getInstance();
      }
  
      public static synchronized ApplicationService getInstance(){
          if(applicationServiceInstance == null)
          {
              applicationServiceInstance = new ApplicationService();
          }
          return applicationServiceInstance;
      }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>public class DerogationService {
  
      private DerogationDao derogationDao;
      private ApplicationService applicationService;
      private DroitService droitService;
      private static DerogationService derogationServiceInstance;
  
      private DerogationService(){
  
          applicationService = ApplicationService.getInstance();
          droitService =  DroitService.getInstance();
          derogationDao = DerogationDao.getInstance();
      }
  
      public static synchronized DerogationService getInstance(){
          if(derogationServiceInstance == null)
          {
              derogationServiceInstance = new DerogationService();
          }
          return derogationServiceInstance;
      }
  </code></pre>
  
  <p>Thx guys ! :)</p>