I am currently working on modeling my domain and I am trying to
implement a has-a relationship with Zend_Db_Table rather than an is-a
relationship.
So for say my product model I also have a product_table which I use
the rowClass to call my productFactory which creates product instances
that have-a Zend_Db_Table_Row.
All this works fine but I want to achieve more abstraction between my
table and row classes so I can cleanly test my model, to do this I
want to create an interface that my product_table/_row classes
implement so my models have a common interface to use. This way I can
easily swap my table/row classes with test objects.
So my question is how come none of the db classes have interfaces? I
would also be interested in knowing anyones views on this approach to
using Zend_Db_Table.
Thx
Keith
没有评论:
发表评论