I will have a model for each table on my simple sites. I can use any number of models in my controllers. In more complex examples where the client and the cart are not separate, I have a model that combines them together with methods that both tables know.
You have many models, very subtle controllers, and only HTML in your views. Your controllers should have many if statements that receive results from the controllers. Your views may “hang” on this cycle and repeat the results, but no other logic. There are no HTML tags anywhere except your views.
To answer your question, you may have the following models.
- Users [get to user table]
- Cart [Enter the basket table]
- product table and user table]
- Products [fall into the product table]
- Orders [table of users, carts and products (as a simplified simplified example)]
- PageState is a model that tracks the status of your users on your site.
You have the following controllers
Controllers can be very long, but each action is small, with a specific task. I think it is normal to have a controller with 10 actions if these actions are good and short.
The models that trigger these actions can be quite long and usually need to take into account business logic. I also use helper classes to do things that are not business logic, but are still critical. Think about security and verification.
And a whole bullet of glances. Presentations for the basket, for the login window, for a product summary, a detailed description of the product, each phase of verification, receipt, views for sending by e-mail in HTML format, a list of categories, menus, footers. Many and many species.
You would like to have some ApplicationClass that all your controllers inherit so you can do something over and over again.
You mentioned php, so you have the views that make up your template, but if you made ASP, you will have a main page that will run partial views. I don’t know exactly what you are doing in Ruby or Python, but it does.