PHPnews.io

Overview for 'paulmjones'




Controllers are Services

Written by Paul M. Jones / Original link on Dec. 9, 2019

tl;dr: Contra my previous opinion,controllers are Service objects; my understanding of a "Service", regardingDI/SL Containers, was incorrect. However, I do continue to opine that it isbetter use a Factory to get new Controller instances, rather th...


Controllers are not Services

Written by Paul M. Jones / Original link on Dec. 7, 2019

Controllers (in webbish MVC) and Actions (in ADR) are not Services. That is, their instances are not shared throughout the system. They are not shared objects used in many different places. Each is created and used only once, in one place, usually as...