Answer the question
In order to leave comments, you need to log in
How to properly organize routing and controllers in an application?
I'm working on a module for creating email companies.
In the process of creating a company, you need to go through several steps, enter data about the sender, set up a template, and so on.
I have several Templates, Info, Campaings entities. Each entity should have its own routing, models, controllers.
For example, when creating a new company, how to act correctly:
send several post requests corresponding to each entity
or send one post request and do all the operations in it.
Answer the question
In order to leave comments, you need to log in
You are a little bit from the wrong angle IMHO came to the task. Is the operation of creating a new company atomic? That is, you need to create all entities at once and none if a failure occurs? How is the company set up? Is it a wizard or a single page form? You first need to answer these questions.
And if abstractly, then to reduce the load on the server, one request is always better than several consecutive ones. Another thing is whether the application logic allows this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question