pchemguy/SecureADODB-Fork

IDbConnection_CreateCommand interface constitutes unnecessary coupling

Closed this issue · 0 comments

IDbCommandFactory takes an IDbConnection interface and returns an IDbCommand interface with the logical place for initialization of the object behind it 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, as illustrated on the attached class diagram (also commit 8de5cbb). The last two calls can be removed to resolve this issue.

Implemented in commit 67c8415

SecureADODB_CreateCommand