Welcome Guest, Not a member yet? Register   Sign In
General question: Seperate controller or a function???
#2

[eluser]Jelmer[/eluser]
It's all up to you. I used to create big controllers with all functionality related to a certain topic in one controller. But in the end that makes it harder and harder to find problems when they arise.
I've slowly started to divide functions over more controllers for maintainability, even in some "finished" applications (as far as such a thing as a "finished" internet application exists). And functions that need to be shared between functions from different controllers go into libraries. It makes for very readable controllers that are easily read and maintained, or functionally changed because of those first two. (especially when you really put all your HTML in views and language in language files)

There also might be a memory arguement to be made, but I've never done any testing on whether functionally equal implementations with one or multiple controllers have significantly different memory or processing time requirements.

Also I'd suggest using different functions for add & update instead of switches for add and update cases, but that's also more an opinion for readability than really based on any functional arguement.


Messages In This Thread
General question: Seperate controller or a function??? - by El Forum - 02-15-2010, 04:41 PM
General question: Seperate controller or a function??? - by El Forum - 02-15-2010, 05:27 PM
General question: Seperate controller or a function??? - by El Forum - 02-15-2010, 09:47 PM
General question: Seperate controller or a function??? - by El Forum - 02-16-2010, 04:43 AM
General question: Seperate controller or a function??? - by El Forum - 02-16-2010, 06:36 AM
General question: Seperate controller or a function??? - by El Forum - 02-16-2010, 07:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB