You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does anyone have a or know of a concrete example of php code that would reflect "Clean Architecture" page 166 figure 17.1. I simply can wrap my head around it?
the attached code represents examples of what I have written so far, but I know this will not work for anything but a SQL database. In my example My use case is simple, I am trying to have a use log into the system. Please ignore my namespace names as I am trying to rework my code from a homemade "MVC" framework. Finally the view component was not included because it is trivial, it send a json string.
Many principles described in this project are not followed.
Validation rules are more appropriately move from the controller on a separate layer.
Do not forget about the principles of a thin controller and a thick model.
Your model is similar to ActiveRecord, which is anti-pattern and contrary to the principles of DDD.
I recommend to look at Doctrine ORM.
And I recommend not to invent your own, but to take a ready-made frameworks, for example, a Symfony. In frameworks, much of what you are doing is already implemented. The frameworks teach programming culture and instill best practices, although some of them are controversial.
Does anyone have a or know of a concrete example of php code that would reflect "Clean Architecture" page 166 figure 17.1. I simply can wrap my head around it?
the attached code represents examples of what I have written so far, but I know this will not work for anything but a SQL database. In my example My use case is simple, I am trying to have a use log into the system. Please ignore my namespace names as I am trying to rework my code from a homemade "MVC" framework. Finally the view component was not included because it is trivial, it send a json string.
Thanks
ken
Login Code.zip
The text was updated successfully, but these errors were encountered: