Welcome Guest, Not a member yet? Register   Sign In
General Architectural Question
#1

[eluser]Unknown[/eluser]
I have been working with CI for a few weeks and really like the implementation of the MVC and the abundant helper classes, etc.

But in trying to debug a problem I was having I issued a "print_r(<very simple model>);" and was SHOCKED by the 43MB of output. In looking out dump it looks like the CI guts are coupled and re-coupled and coupled again! Sure, you're model needs to be coupled with your database class implementation and db config, but why all the other config objects? Why the URI object? Why the router object? Those are controller related, not model related.

Am I wrong - is CI a thin MVC veneer over a huge, nastily coupled mess?
#2

[eluser]xwero[/eluser]
In short yes. CI uses a super object where all the classes are added to.

But i'm wondering how you get 43mb of output. I never seen that even with a massive amount of db rows. How did you check it?
#3

[eluser]Unknown[/eluser]
This was a print_r of the concrete model
Code:
print_r($this->CustomerModel);
itself, not any method output. The model doesn't even have a default table or database, just some cohesive calls to stored procedures for retrieving customer data.

Are all the child objects static (loaded on initialization of response session) or dynamic (loaded as invoked)?
#4

[eluser]xwero[/eluser]
10 classes are loaded by default : Benchmark, Hooks, Config, Router, Output, Input, URI, Language, Controller,Exceptions (11 in php4 Loader). Everything else you load dynamic.
#5

[eluser]xwero[/eluser]
I did the same test as you and i got only a 151kb with database output. I recognised the config, the db, the session, a custom library and some general variables.

Now i really want to know how much libraries you add Smile




Theme © iAndrew 2016 - Forum software by © MyBB