Esempio n. 1
0
        public static CentralElectrica getInstance()
        {
            if (centralElectrica == null)
            {
                centralElectrica = new CentralElectrica();
            }

            return(centralElectrica);
        }
Esempio n. 2
0
 public static void patronSingleton()
 {
     patronAbstractFactory();
     CentralElectrica ce = CentralElectrica.getInstance();
     IResponsable     b1 = ce.getPersonal();
     IResponsable     b2 = ce.getPersonal();
     IResponsable     b3 = ce.getPersonal();
     IResponsable     b4 = ce.getPersonal();
 }
 public ICuartel crearCuartel()
 {
     return(CentralElectrica.getInstance());
 }