views:

208

answers:

2

I have found this tutorial online

http://net.tutsplus.com/tutorials/php/creating-a-php5-framework-part-1/

I have created myself a simple sort of framework, but I have not been too knowledgeable whether I have followed best practices and the like... which I really would like to do.

I am looking at making my framework more unified by the MVC pattern. It seems I have sort of followed the principles, but I won't be happy until I can say my framework follows the design verbatim (and can, when it needs to be, easily picked up by another developer).

My question is, is this tutorial online a good place to start? I am using PHP5 with Apache.

Please note, I am not looking for the 'Why reinvent the wheel' type of answers, I'm doing this for fun and as a learning experience.

+2  A: 

Alex, I must say I haven't read the article and please don't take this the wrong way, but I think the best way to learn about shortcomings of your own framework or to find out if it meets certain standards is to open it up - make it open source - and let other developers take part in it. They will be pretty quick to complain or point out flaws.

Even if your only goal in creating this framework is to learn, I think you can benefit from a code review. And what better way to get a code review than by inviting other people to join you in your "quest".

This way you should also have the chance to challenge the others code and maybe ask questions to find out why they write code a certain way.

I hope you'll find this at least a little bit helpful ;)

P.s. I'm going to take a look at that link now..

Miky Dinescu
This is a good point... Thanks
alex
Let me know what you think after checking out that link? I've noticed it uses the old fashioned trigger_error() which has made me slightly skeptical.
alex
A: 

I haven't read the article you referenced, but one way to find out if your framework is useful is to try using it in a different way than we did before.

You may want to experiment with when to use classes in PHP and when not to, as it isn't one size fits all.

You may want to try to not have your business logic tied up in the same php file as your html, but keep them separate if you want to follow good MVC practices.

Good luck. :)

James Black