views:

330

answers:

5

I know PHP and am just beginning with MySql (but plan to use ODBC). I don't need any books explaining that.

I am probably qualified to develop a simple web site, but aim at taking on quite ambitious apps. I imagine that almost all web apps have some commonality like security, scalability, etc (I have absolutely no idea how to distribute a data base or an app over server servers, for instance).

Since I can't foresee the exact nature of the applications which I might develop (other than that PHP & ODBC will be involved), is there any point in getting married to a framework, or should I just reinvent the wheel and personalize it to make it my own framework.

If an existing framework, then which one. The only help I can give is that I am not likely to do websites, portals, shoppings sites, etc, probably leaning more to asset tracking and data mining.

+2  A: 

Good frameworks give you a ready solution to common problems. Reinventing solutions for yourself probably will be excessive work. As a learning exercise coming up with stuff for yourslef has some value. To get a real job done efficiently use a framework.

This does assume that good frameworks exist in your world ...

djna
+1. Although most frameworks out there try to solve all problems at once and interoperate with about any popular technology, but rarely excell speficic task. Most of the time you wind up hacking around a lot within that framework. The alternative is to write your own app-specific framework. A rule of thumb, that I found for myself, is that, if you master a framework, you are extremely productive while it covers your requirements, but might slow down drastically crossing that line. an own framework takes a long time to design and write, but doesn't have that problem (if you do it right!).
back2dos
+1  A: 

I currently am developing in the PHP framework Kohana (version 3). There is also a way to make models (for the (H)MVC pattern) very quickly using ORM. For more information look at this: http://kohanaframework.org/guide/tutorials.orm and take a look at http://kohanaframework.org/guide/api and http://kohanaframework.org/download

VDVLeon
+1  A: 

Frameworks are great for making sure you code to a regimented fashion and that your code is readable. They also offer lots of code library's that will be able to save you alot of time in developing web apps.

Zend framework has a huge amount of code library's that you can include into your app to extend it easily, and for data mining having access to these library's would be very beneficial as I'm sure there are many data mining library's already made for Zend.

Symfony framework great for developing websites quickly and is very strict using innodb for its database tables which insures database integrity and is useful if you intend to develop a strict relational database. The admin generator is also amazingly quick for developing content management systems for websites you design.

If you are going to take on a framework I would look at this tutorial http://anantgarg.com/2009/03/13/write-your-own-php-mvc-framework-part-1/ which walks you through your first MVC(model view controler) framework and is far more simple than jumping straight into a full framework like Zend. I would just follow this tutorial until you have a decent grasp coding in an mvc style, its not really worth re-inventing the wheel due to the amount of time involved and the quality of existing frameworks.

Hope this helps

Luke

Luke
+1  A: 

Using a framework saves you a ton of time and helps you to organise your app mroe logically.

If the app is small then frameworks like CodeIgniter or Kohana are ideal.

If you are building a bigger app that needs to scale the Symfony or possiby Zend are the ones to look at.

If you were to start your app in Symfony you would instanly get:

  • url rewriting using routes
  • a form framework for handling everything to do with your web forms
  • internationalisation and localisation
  • emailing
  • caching
  • admin area generator, to help you add data quickly
  • unit testing framework

Plus the whole framework is extendable and custmisable to suit your needs.

Starting without a framework you'd have to write all of this yourself. Or integrate several disparate open source modules.

Hope this helps.

Jon Winstanley
+1  A: 

There are already some good answers to "which framework" question for PHP on StackOverflow, so I won't go into those.

However, as far as libraries go I would recommend using the ADODB library (easier proper sanitisation of input, supports multiple DB's, better API than PHP's native DB specific classes) and writing a few classes of your own.

A good example of a "lite" framework that provides templating (and that is also a good example of a well written framework) is Smarty (which is used by the W3C on their website - not a bad endorsement). To some it seems redundant to have a templating language in PHP, but it does help enforce a notable degree of separation of presentation logic vs application logic.

I think it's best steer clear of frameworks on PHP until you see something that really meets a need you can't solve easily without it.

My take on it is that you are happy writing your own classes and small site specific frameworks you'll be better able to evaluate other frameworks more easily (I regard this as a unique challenge with PHP as there is a bit of over supply of crummy frameworks that gets in the way of finding the good ones).

Iain Collins
+1 Thanks for the ADODB library. I did toy with Smarty for a website, as opposed to an app, but agreee that W3C recommendation means something. Many seem to recommend Symfony, so it's like a cross between that and rolling my own. I will investigate it further.
Mawg
Coming across ADODB was a big "Why haven't I heard of this before?!" moment for me. Would be interested to know what your experiences are if you feel like updating the post down the line.
Iain Collins