Object-oriented design advice
Posted: Fri Feb 12, 2010 12:33 pm
Hi everyone,
I've started building a php framework. I have two questions and will be very grateful if you share your oppinion with me.
Here are the questions:
1) I’ve created one front controller for my site, which acts as an entry point to it. The problem is that I have to put ajax, but I don’t think, it would be good practise to invoke other php scipts as an entry point to my site, because of security reasons. Do you agree with me? Should I use the front controller for ajax too and after that create something like strategy pattern, which decides, whether it should invoke either classes which serves ajax requests or other classes, which serves to the non-ajax requests?
2) I think to put any configurations in conf directory in xml files (or .properties files). Would it be safe for the website, because xml can be opened through browser? I will write a redirect to index.php in .htaccess, but anyway I don’t know that this is enough.
I've started building a php framework. I have two questions and will be very grateful if you share your oppinion with me.
Here are the questions:
1) I’ve created one front controller for my site, which acts as an entry point to it. The problem is that I have to put ajax, but I don’t think, it would be good practise to invoke other php scipts as an entry point to my site, because of security reasons. Do you agree with me? Should I use the front controller for ajax too and after that create something like strategy pattern, which decides, whether it should invoke either classes which serves ajax requests or other classes, which serves to the non-ajax requests?
2) I think to put any configurations in conf directory in xml files (or .properties files). Would it be safe for the website, because xml can be opened through browser? I will write a redirect to index.php in .htaccess, but anyway I don’t know that this is enough.