Typically, MVC frames have a structure that looks something like this:
/models /views /controllers /utils
However, in the web application suite, I decided that combining all the models, views, and controllers together probably would not be the best for clarity, unless I consider the system as a single application, rather than a collection of applications. However, some things bind each โapplicationโ together as a concept of users and user roles.
So, I have three possible solutions:
(1) Do what I really don't want to do, and keep each model, view, and controller together, no matter which application it belongs to. This refers to the package as a single application, since they are connected to each other by several common threads, including users.
(2) Group the code using the application.
/app1 /models /views /controllers /utils /app2 /models /views /controllers /utils
(3) Group the code by type, allowing you to use the utility code for all applications.
/models /app1 /app2 /views /app1 /app2 /controllers /app1 /app2 /utils
Is there an option that I missed? What will be the most logical scheme for future developers? I personally prefer 2 and 3, but perhaps most people would expect 1.
frameworks model-view-controller
Thomas Owens
source share