I am using the CakePHP framework to implement a Web application. I would add my application a design pattern, specifically, the Template Method pattern.
Regardless of the pattern you want to implement, where should I create interfaces (and classes) to implement a design pattern that can be used for a model?.
Where should place the files that shape a pattern (/ app / models, / app / controllers, …)?.
Design patterns that I add to my application, should be used by the models or controllers?.
Thanks for the help,
Greetings!
First of all, I did a lot of projects (small, medium, large) using CakePHP but never needed any extra pattern (They have already used many patterns in core). Maybe my applications were not that complex 🙂
In my opinion it would be better if you make plugins. You can make them
componentorbehaviourdepending upon your usage.You can always create new folders. I think creating a new
/interfacesfolder would be a great idea.No, don’t put them under
controllersormodels. As I mentioned above makecomponentorbehaviour.