Re: Peoples thoughts on processing tasks
| From: | Jan-Eric Duden | Date: | Fri, 27 Oct 2000 04:05:10 +0000 |
| Subject: | Re: Peoples thoughts on processing tasks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22260@lists.php.net to get a copy of this message | ||
Hi !
> I am in the middle of a pretty involved php application. We have all the
> parts working in some shape or form and are ready to start redifining and
> cleaning up code, working things out and creating an order and 'template'
in
> which to create our new projects. If anybody could offer there thoughts on
> the following, perhaps offering pros and cons (if it is not too much
> trouble).
>
> How do you go about processing functions and task.
> Do you keep them on one page. Then asign an action variable to the
url,
> the script would then check to see what action is equal to and carry out
its
> equivalent in an if statement. This process would also involve creating
> functions to do the things are done often.
>
> Or keep every task in a serperate php file. Having a file for each
> function that is done often.
This is a good question - i have been thinking about about this issue since
i've got involved in php programming stuff.
since both approaches have pro and cons ...
I am currently doing something in between
I use one file for each class/group of functions that implements reasonable
functionality
- e.g. 400-1000 loc per file
thus a bigger / more complicated task gets one single file
whereas a smaller but logically related tasks share a file
>
> What about speed and reliability, does anybody know which is the faster
> method or if there is a better one?
I don't know I don't have any performance problems but I don't have any
heavy traffic either since
nobody can access my upcoming site yet :)
In some weeks I ll know more about performance of this approach...
>
> Anything else I should know about??
>
Jan-Eric Duden