Про репозитории и сервисы

Блог им. xoma 19 сентября 2014 г., 12:19

A repository is a service. In fact, pretty much everything that is not a domain object is a service.

What I often see is people making really fat services with lots of responsibilities, so they still have the same problem as with the fat controllers. Make services with a single responsibility and a very clear name. Avoid using words like 'Service', 'Manager', ... in the name, that will force you to find some meaningful.

http://verraes.net/2011/03/keep-you-controllers-thin-with-doctrine2/


Комментарии 1

xoma
xoma
yes, the repository patterns was specifically born to incapsulate all the methods you need to retrieve objects from the DB. So you basically add there all the possible queries you need in your application…
Пожалуйста, авторизуйтесь или зарегистрируйтесь для комментирования!