Where do DQL statements live in an application that is using Zend Framework and Doctrine

Posted by Dewayne on Stack Overflow See other posts from Stack Overflow or by Dewayne
Published on 2010-06-11T23:09:03Z Indexed on 2010/06/11 23:12 UTC
Read the original article Hit count: 346

In an application that is using Zend Framework 1.10 and Doctrine 1.2, where should the DQL statements live if our application is built such that it has a Service Layer and a Gateway(aka Doctrine_Table) layer.

It seems that our possibilities include:

1) Placing the DQL statements in the Service layer which seems to be a bit too high in our application hierarchy to store DQL.

2) Placing the DQL statements within each model's Table/Gateway which seems a bit redundant because we also need to expose the DQL statements that do things such as getAllUsers() through the Service layer.

Which of these is a preferable design? We intend to make use of the Service layer as much as possible so that other projects might consume various parts of our application.

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about orm