OOP design of the adapters mecanism in Zend_Db. Since Zend_Db is not using
interfaces, we have Zend_Db_Adapter_Pdo_Ibm_Db2 which derives or
implements… nothing. We then have Zend_Db_Adapter_Pdo_Ibm which internally
creates a Zend_Db_Adapter_Pdo_Ibm_Db2 and wraps the methods, but doesn’t
really enforce any interface or base class. Zend_Db_Adapter_Pdo_Ibm is an
adapter which wraps fake adapters… and we can’t use
Zend_Db_Adapter_Pdo_Ibm_Db2 directly, since it doesn’t derive from anything
so we can’t pass it to Zend_Db_Table for example. We also can’t reuse code
or implement an interface in Zend_Db_Adapter_Pdo_Ibm_Db2.
I hope that Zend_Db interfaces will be added and enforced in Zend Framework
2.0, or we’ll be stuck with this frankensteinized OOP 😉
View this message in context: http://www.nabble.com/Something-fishy-with-adapters-in-Zend_Db-tp25388420p25388420.html
Sent from the Zend DB mailing list archive at Nabble.com.