Well lately I've been reading Martin Fowler's book on domain logic design patterns, according to Fowler the two patterns are somewhat mutual-exclusive. They both are classified as Data Source Architectural Patterns, and you usually choose one over the other depending on the circumstances. However, after reading this page on stackoverflow.com, it seems that they can be used together, at least in Zend:

http://stackoverflow.com/questions/804751/what-is-the-difference-between-the-data-mapper-table-data-gateway-gateway-da
(the last post in this article talked about Zend's implementation)

So I was wondering, is it a good practice to use Table Data Gateway together with Data Mapper, especially in large applications? What are the primary benefit for this?

    Write a Reply...