Обложка канала

Amazing PHP

8898 @phpme

Welcome to the Amazing PHP Channel!Here you can find a lot of interesting articles/news about PHP, frameworks, tools and development.

Amazing PHP

7 лет назад
Открыть в
Dividing responsibilities - Part 1
We've looked at how objects can be used to retrieve information or perform tasks. The methods for retrieving information are called query methods, the ones that perform tasks are command methods. Service objects may combine both of these responsibilities. For instance, a repository (like the one in Listing 1) could perform the task of saving an entity to the database, and at the same time, it would also be capable of retrieving an entity from the database.