Hi,
I'm building adaptators for DB components in order to not modify my application if I choose SLQB compoents or zeoslib.So I use a factory class to bluid a
TDatabaseManager with only a generic interface, without any referencesto specifics types from SQLDB or zeoslib techicals libraries. Si this my DAO généric class using the factory and manager TDatabaseManager :
IDAOClasse = specialize IDAO<TClasse>;
TDAOClasse = class(IDAOClasse)
private
sgDbm : TDatabaseManager;
public
constructor Construire(dbm : TDatabaseManager);
destructor Detruire;
function Ajouter(const obj : TClasse) : TClasse; override; // Ajoute un nouvel objet T
function Instancier(const id : integer) : TClasse; override; // Lire un objet T existant
function Collection(strSQL : String) : TDataset; override;
function Sauvegarder(const obj : TClasse) : TClasse; override; // Mémoriser un objet T
procedure Supprimer(obj : TClasse); override; // Supprimer un objet T
end;
My question is about the method :
function Collection(strSQL : String) : TDataset; override;
If I use
zeoslib inside the implementation of
TDatabaseManager, I will use a
TZQuery with TZAbstractDataset. Do you think it will be compatible with a
TDataset result ?