examples icon indicating copy to clipboard operation
examples copied to clipboard

SecureADODB: Existence of IDbConnection_CreateCommand appears counterintuitive

Open pchemguy opened this issue 4 years ago • 0 comments

What is the idea behind the IDbConnection_CreateCommand interface method? IDbCommandFactory takes an IDbConnection interface and returns an IDbCommand interface with the logical place for initialization of the object behind it (as initiated via the .Execute method) being the IDbCommandBase_CreateCommand interface. However, IDbCommandBase_CreateCommand in turn calls IDbConnection_CreateCommand interface, which merely duplicates the Guards present in IDbCommandBase_CreateCommand and then sets basic command properties passed from IDbCommandBase_CreateCommand. It appears that this way unnecessary coupling and a loop IDbConnection->IDbCommand->IDbConnection are generated. I would remove the IDbConnection_CreateCommand interface, placing all of the necessary code in IDbCommandBase_CreateCommand. I can submit a pull request for this issue.

SecureADODB_CreateCommand

pchemguy avatar Jan 27 '21 21:01 pchemguy