[SOLVED]..What should be the maximum number of function in a controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [SOLVED]..What should be the maximum number of function in a controller (/showthread.php?tid=29015) |
[SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-28-2010 [eluser]ranjeet_sangle[/eluser] Hello friends, I am working on a project in which there are 40 utilities. I am trying to create a single controller class that will handle all these utilities. But I think that this will make the size of the controller class very large. So this may lead to large computational delay. Also I am having a team with me hence different developers will be working on the same project.But with a single controller class this is not feasible. Can anybody suggest me a solution to this problem? [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-28-2010 [eluser]LifeSteala[/eluser] It sounds like to me these utilities are 'tools' therefore they should be Helpers? Just thinking out loud here... [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-28-2010 [eluser]ranjeet_sangle[/eluser] you can call utilities as a function or a tool. [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-28-2010 [eluser]JoostV[/eluser] Why would you like to place different tools in a single controller? Cramming all this in a single controller will make it bloated, unmaintainable, etc: you pointed out the cons yourself. [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-28-2010 [eluser]Zack Kitzmiller[/eluser] With out knowing more about this project, I'd say one controller per tool. There's no problem with having a large number of controllers. [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-28-2010 [eluser]ranjeet_sangle[/eluser] Thank you sir...!! That means it simply doesn't matters how many controllers we are using..? I think I must go for a single controller per tool. But this will result in creating 40 controllers. [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-29-2010 [eluser]JoostV[/eluser] You can create an unlimited amount of controllers, yes. You can create one per tool, or group the tools into meaningful groups and create a controller per group, for instance Code: class User extends Controller [SOLVED]..What should be the maximum number of function in a controller - El Forum - 03-29-2010 [eluser]ranjeet_sangle[/eluser] I got you sir.. very much thankful to you |