public static CentralElectrica getInstance() { if (centralElectrica == null) { centralElectrica = new CentralElectrica(); } return(centralElectrica); }
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()); }