【发布时间】:2008-09-19 08:40:44
【问题描述】:
是否可以这样做:
interface IDBBase {
DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);
...
}
class DBBase : IDBBase {
public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) {
...
}
}
我想使用接口来实现 d/t 提供者(MS-SQL、Oracle...);其中有一些签名要在实现它的相应类中实现。我也试过这样:
genClass<typeOj>
{
typeOj instOj;
public genClass(typeOj o)
{ instOj=o; }
public typeOj getType()
{ return instOj; }
...
interface IDBBase
{
DataTable getDataTableSql(DataTable curTable,genClass<idcommand> cmd);
...
}
class DBBase : IDBBase
{
public DataTable getDataTableSql(DataTable curTable, genClass<SqlCommand> cmd)
{
...
}
}
【问题讨论】: