It is easier to manage classes with its own file. If you create an email class then it should be saved in a file named mailer.php This class may need many other classes, the problem begins here. Now you must have to include all needed class files in the mailer file to work properly. But if you have a much bigger framework to work with, then it will be hard to manage the long list of file inclusion manually.

In PHP5 we have a solve for this problem. You may define an __autoload function which is automatically called in case you are trying to use a class/interface which hasn’t been defined yet.

Read the rest of this entry

, , , , , , , ,