Welcome Guest, Not a member yet? Register   Sign In
structure object error
#1

[eluser]jorgeakanieves[/eluser]
I have built a codeigniter special app to load a schema view sending from requested controller the body to schema and loading from here the rest of views(header, footer, and else...).

The problem is herency and objects arquitecture.

In schema error.php i´ve the same objects than home.php but in html_class.php or header_class or footer_class, i´ve missed these objects. why?
#2

[eluser]jorgeakanieves[/eluser]
I have solved this creating in each class the CI instance ($this->CI=& get_instance()Wink
but I think it reloads the objects and overloads the page load. The object strutcture is on schema solution image.

do you think is it a good practice object structure?
#3

[eluser]jorgeakanieves[/eluser]
anybody give an opinion?
#4

[eluser]Mirage[/eluser]
Well, I'm trying to get my head around your schematic.

It looks as if your schema.php is a sort of 'base-controller' which you extend to your final ('home') controller. I've done this in some situations, so there's nothing inherently 'bad' about your approach.

What are your specific concerns?
#5

[eluser]jorgeakanieves[/eluser]
I´m worried about heavy objects and recursion, you know? the time to load the page may be high if I load several libraries...
#6

[eluser]Mirage[/eluser]
Well, I don't know what your hosting environment is, but my experience is that 'including' files incurs the least performance penalties. Building up [remote] database connections is costly, fetching humongous resultsets for displaying a single record is costly, endless iterations in poorly constructed loops can be costly. Bloated resources (javascript libraries, images) [can] make your pages slow long before the dynamic stuff does.

Your approach of course has much to do with your or your clients goals. The people I do work for don't care about speed as much as they do about time-to-market. Being first comes before being best (aka fastest) [to them].

Priority One: Get things working the way you want/need them to!

You're the one who has to write and [likely] maintain the code. So be comfortable with your approach from that perspective. Scalability and speed are great problems to have. But you need to get there first. And once you arrive there a lot's of solutions to help get your performance up. There's a really nice breakdown by Elliot Haughin on which things make a difference: http://www.haughin.com/2008/02/13/optimi...plication/

But still - don't spend too much time worrying about it upfront.

Hope this helps.
#7

[eluser]jorgeakanieves[/eluser]
Thanks a lot. I´m trying to do my best. Time is not the problem, I´m developing a personal build application.




Theme © iAndrew 2016 - Forum software by © MyBB