Welcome Guest, Not a member yet? Register   Sign In
Where to load models, helpers, libraries? Autoload? Constructor? Method?
#1

[eluser]CodeIgniterNewbie[/eluser]
Any guidance on where to load models, helpers, and libraries?

If they are loaded in autoload, they are made available to the entire application. What if the entire application doesn't need it? Loading in constructors offer reduced scope, but still the same problem: what if the entire class doesn't need the resource? Loading in the method offers the least scope, but this means you'll have to load the same resource over and over again (once each time you need it).

My concern is that I load things not needed by the application (perhaps the memory footprint becomes too expensive?). Also, loading in autoload or constructor could lead to them being loaded and NOT being used (e.g. due to code changes and forgetting to double check those places).

Suggestions for best practice?


Messages In This Thread
Where to load models, helpers, libraries? Autoload? Constructor? Method? - by El Forum - 08-09-2010, 08:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB