This question can be applied to any programming language, but as I am thinking of PHP, I will phrase it accordingly…
I’m wondering if it is considered bad design/architecture if a web application uses action parameters, versus seperate files for each action.
For example:
/index.php?action=edit
Versus
/edit.php or /index/edit.php
I know mod_rewrite can translate a pretty-url to a parametrized url, but I try to avoid uneeded complexity when not necessary.
Thanks.
Quite often, for big applications, (especially with Frameworks, such as symfony, Zend Framework, …) we tend to use one entry point :
index.php.That entry point will receive some informations (like your
actionparameter), that will allow it to route the request to the correct controller (or any equivalent you might have).So, to make things short : no, using action parameters is not bad design / architecture.
Of course, this depends on the kind of application — but, generally speaking, have a unique entry-point is quite a good idea.