lundi 23 novembre 2020

Controllers should contain all the requests from a specific entity or screen?

Controllers should contain all the requests from a specific entity or screen? For example, lets say we have a screen where whe can save new clients of a Electronic shop, edit exiting ones, etc. So we could create a ClientController. We have other screen where we can save and update our electronic components stock. So we could create a StockController. But, what about if we have other screen where we are asked to show a list of clients and a list of the stock components. Where do these two requests should go?

  1. Should the last two requests should go to a different controller named ListsController or something similar?

  2. Should the list of clients should go to the ClientController and the list of stock to the StockController?

What do you think are the benefits or reasons to choose any of the options?

Thanks!!

Aucun commentaire:

Enregistrer un commentaire