-- Ralf Eggert <r.egg...@travello.de> wrote (on Thursday, 15 April 2010, 02:10 PM +0200): > I have a question regarding a model infrastructure that uses models, > data sources, data mappers and a service layer. I like this concept a > lot but am still thinking about one issue. > > I want to get a list of all blue articles which have been ordered by > users from Germany and have been paid last month. Thinking about the > database this will definitely be a rather complex database join about at > least three tables (articles, users, order). Lets call this method > fetchBlueArticlesOrderedByGermanyPaidLastMonth(). > > Where should this method be located? > > - in the data source (Zend_Db_Table class) > - in the model > - in the data mapper > - in the service layer > > I could find pros and cons for each solution if I want to. But what do > others think?
I typically think of this as a job for the mapper, as it's mapping the data source to objects. That gives you the flexibility of either wrapping it in your service layer (I do this so I can return a paginator object) or simply calling it as a method off your mapper. -- Matthew Weier O'Phinney Project Lead | matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc