In CakePHP we have many conventions which tell us where to place certain files: controllers are placed in app/controllers, models in app/models, views in app/views, and so on. Only for one category of files there is no (explicit) convention of where to place them: the files containing “normal” classes you want to use anywhere.
According to a comment by gwoo those files should be placed in the vendors folder: “Vendors is fine. Any classes that are not part of the MVC are considered 3rd party classes.”
Sure, this works. Only, it means you have to mix two different concepts: on the one hand you have classes you get from someone else (the “vendor”) and which you usually don’t touch (and often don’t follow the Cake conventions), and on the other hand you develop your own non-MVC classes following the Cake conventions in the same folder. To me this doesn’t feel right…
And so I think there should be a convention like “Non-MVC classes are placed in app/libs” to separate “internal” and “external” libs and to show in the “app” folder the fact that an application (often) consists of utility classes and external libraries.
Such a convention would also help to avoid comments like the following comment for a class defined in a AppModel: “q: Why is this in the app_model file? a: Because we couldn’t really think of a better place. Suggestions are most welcome.”