Ejemplo n.º 1
0
        public static IPersonDAO GetInstance(string type)
        {
            IPersonDAO db = null;

            switch (type)
            {
            case "Binary": db = new PersonDAO_Binary(); break;

            case "BinaryL": db = new PersonDAO_Binary_L(); break;

            case "MS SQL": db = new PersonDAO_MsSQL(); break;

            case "MY SQL": db = new PersonDAO_MySQL(); break;

            case "H2": db = new PersonDAO_H2(); break;

            case "MONGODB": db = new PersonDAO_MONGODB(); break;

            case "CSV": db = new PersonDAO_CSV(); break;

            case "JSON": db = new PersonDAO_JSON(); break;

            case "XML": db = new PersonDAO_XML(); break;

            case "YAML": db = new PersonDAO_YAML(); break;

            case "CSV_L": db = new PersonDAO_CSV_L(); break;

            case "JSON_L": db = new PersonDAO_JSON_L(); break;

            case "XML_L": db = new PersonDAO_XML_L(); break;

            case "YAML_L": db = new PersonDAO_YAML_L(); break;

            case "MS SQL EF": db = new PersonDAO_EF(); break;

            case "Mock": db = new PersonDAO_Mock(); break;
            }

            return(db);
        }
Ejemplo n.º 2
0
        public static IPersonDAO getInstance(string key)
        {
            IPersonDAO db = null;

            switch (key)
            {
            case "MsSQL": db = new PersonDAO_MsSQL(); break;

            case "MySQL": db = new PersonDAO_MySQL(); break;

            case "H2": db = new PersonDAO_H2(); break;

            case "MongoDB": db = new PersonDAO_Mongo(); break;

            case "CSV": db = new PersonDAO_CSV(); break;

            case "JSON": db = new PersonDAO_JSON(); break;

            case "XML": db = new PersonDAO_XML(); break;

            case "YAML": db = new PersonDAO_YAML(); break;

            case "CSVLib": db = new PersonDAO_CSV_Lib(); break;

            case "JSONLib": db = new PersonDAO_JSON_Lib(); break;

            case "XMLLib": db = new PersonDAO_XML_Lib(); break;

            case "YAMLLib": db = new PersonDAO_YAML_Lib(); break;

            case "Mock": db = new PersonDAO_Mock(); break;

            default: throw new ArgumentException();
            }

            return(db);
        }