private LibraryProxy(DBFactoryEnums factoryEnums) { ILibraryFactory libraryFactory; switch (factoryEnums) { case DBFactoryEnums.MsAccess: libraryFactory = new Ms_Access.LibraryFactory(); break; case DBFactoryEnums.MsAccessPassword: libraryFactory = new MsAccessPassword.LibraryFactory(); break; case DBFactoryEnums.MDBPassword: libraryFactory = new MDBPassword.LibraryFactory(); break; case DBFactoryEnums.MySql: libraryFactory = new MySql.LibraryFactory(); break; case DBFactoryEnums.MsSQLServerExpress: libraryFactory = new MsSQLServerExpress.LibraryFactory(); break; default: throw new NotImplementedException(); } AccountMehod = libraryFactory.CreateAccount(); BookMethod = libraryFactory.CreateBook(); BorrowMehod = libraryFactory.CreateBorrow(); }