Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple controllers vs single controller

I have 5 different modules each of which is a separate sub-system with a controller independent of others. Now I want to build a single system comprises of these 5 modules (no need to change modules).

I am a little bit confused, as to which approach is best to use for this kind of system.

  1. Should I develop a single controller to co-ordinate with all five module controllers (means a controller for co-ordination of other controllers) to make use of modules.

  2. Should I combine the functionality of all five controllers and put them in a single controller (means only single controller for the system).

Its my academic task. Please explain the best approach to choose.

Thanks in advance.

like image 442
Hassan Khan Avatar asked Mar 13 '26 12:03

Hassan Khan


1 Answers

Good approach is that you should create separate control for each module. By this approach you can maintain logic of each module in easily

You can also look at the following link :

What is the advantage of using multiple Controller classes in ASP.NET MVC?

like image 120
Prashant Mehta Avatar answered Mar 16 '26 08:03

Prashant Mehta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!