I found that I need to move some functionality to the service level. In this particular case, it refers to an example regarding zend-paginator.
In this example, the service level is an intermediate step between the controller and the model. This seems to be the intended role, and in certain circumstances it seems to make sense.
This begs me a few questions.
Firstly, could I just as easily move the sample service code to the controller without any real penalty, and wouldn't that help me by deleting the code layer?
Assuming there is a tangible benefit when porting code to the service level, what happens to the rest of my interaction with the cartographer? Does the controller control the service level for some tasks and the mapping for others, or does the service layer become a proxy server for interacting with the card?
It seems that for things like creating a new line from a form, the service level does not add any value, so it literally will be equal to the throughput function at the service level.
Using it for some tasks seems to complicate things later, although using it as a proxy seems like we intentionally introduce code replication and complexity.
Any clarification regarding βbest practiceβ would be very helpful.
source
share