Reply to Re: Best way of calling multiple classes?

Your name:

Reply:


Posted by Jerry Stuckle on 08/29/07 00:39

Phil Latio wrote:
> I'm designing a small framework with a lot of classes (1 file per class) and
> want to know the best method of calling each class?
>
> Obviously I could I call each file that is used but that could be 10 or more
> include statements. I am wonering if there is a better way? It's bit
> annoying you can't build packages like Java.
>
> Cheers
>
> Phil
>
>

I just put in the include statements.

Actually, I don't use include - I use require_once. And if a class
depends on another class (often in my case), the require_once goes in
the requiring file.

That way the main file only needs to worry about what it needs, as each
file takes care of its own includes.

__autoload is good - but it requires extra processing over and above a
require_once, and pretty much everything has to reside in the same
directory.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация