Lazy loading? Better avoiding it?

Posted by Charlie Pigarelli on Stack Overflow See other posts from Stack Overflow or by Charlie Pigarelli
Published on 2011-01-04T23:42:49Z Indexed on 2011/01/04 23:53 UTC
Read the original article Hit count: 189

Filed under:
|
|

I just read about this design pattern: Lazy Load. And, since in the application i'm working on i have all the classes in one folder, i was wondering if this pattern could just make me avoiding the include() function for every class. I mean: It's nice to know that if i forgot to include a class, PHP, before falling into an error, trough an __autoload() function try to get it.

But is it fine enough to just don't care about including classes and let PHP do it by your own every time? Or we should write __autoload() just in case it is needed?

© Stack Overflow or respective owner

Related posts about php

Related posts about design-patterns