interface IAccessLayer{ string GetQueryResultsAsString(string query); DataTable GetQueryResultsAsDataTable(string query); void ExecuteModificationQuery(string query);}
class MSSQLAccessLayer : IAccessLayer{ ///Implement public contract from IAccessLayer}class mySQLAccessLayer : IAccessLayer{ ///Implement public contract from IAccessLayer}class XMLAccessLayer : IAccessLayer{ ///Implement public contract from IAccessLayer}class OracleAccessLayer : IAccessLayer{ ///Implement public contract from IAccessLayer}
public IAccessLayer GetAccessLayer(string dataAccessMedium){ dataAccessMedium = dataAccessMedium.ToUpper(); if(dataAccessMedium == "MSSQL") { return new MSSQLAccessLayer(); } else if(dataAccessMedium == "ORACLE") { return new OracleAccessLayer(); } else if(dataAccessMedium == "MYSQL") { return new mySQLAccessLayer(); } else if(dataAccessMedium == "XML") { return new XMLAccessLayer(); } else { throw new Exception("Error. " + dataAccessMedium + " is not a valid data access method"); }}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: