Has we’ve seen in the previous part, the history of web development has been evolving to a kind of programming state of the art involving techniques and best practice principles.
All these principles are aimed to make a whole web project more easily sustainable, readable, updatable and…enterprise wide in its evolution.
- Pretty urls
- Database abstraction
- Localization (making it international)
- maintainable code (coded with design patterns)
are characteristics that actual web applications/sites should be developed in mind with. More over, a framework helps reduce the developement by providing a series of “functions” that we usually have to develop for a webApp.
Let’s stick to one of these characteristics: The design patterns.
Design patterns are a general reusable solutions to a commonly occurring problem in software design. (wikipedia) Obviously, if all software are developed with design patterns it means that everyone aware of the design patterns can perform a maintenance on the software (and not only the one who developed the so call software)…well…theoretically.
But design patterns will also ease the way you program and reduce the amount of code you type by applying programming principles and techniques. If you want to know more about this just start with the definition of Wikipedia on design patterns.
However, one of them is VERY important when you fancy the use of a framework : The Model View Controller design pattern or MVC.
The be simple, the MVC is an architectural design patterns which implies the separation of the presentation (view), the business logic (controller) and the data (model) to allow the independence of development, testing and maintenance of all the software components.
If it is not clear for you now it soon will be with our first project tutorial using a framework.
What you just have to bear in mind is that NO actual framework can ignore the MVC design pattern.
Of course, a framework which implement the MVC design pattern surely implements other design patterns.
Enough theory please !
As I stated in part 1 of this series of post, the main goal is to create a whole project using a framework and that is what we’re going to do. But first, we have to choose a framework.
Choose a framework
We assume here that the language we are going to use to develop our application is PHP. PHP has been there for a long time and is one of the most popular language in the world. Moreover, every web project I made with it is still working perfectly. PHP has also been the bricks and mortar for several exceptional applications like, for exampe, WordPress, Magento, Drupal…and much much more.
Choosing PHP for your web app is, surely, not a bad choice !
If you type “php framework” in Google you’ll be served with A LOT of frameworks available. And all are stating they’re the best.
I can’t go against that, as for pros and cons, I should have been using all of them.
But I acquired certainties on a bunch of them. I kept several things in mind. the first is: the law of the market. As a web development company we must ensure to be able to integrate the most popular enterprise wide frameworks in the market.
One of the best and robust one is the ZEND Framework. It is stable, it implements MVC and has a lot of libraries ready to ease and reduce the coding work. It is also very flexible as you can use the libraries without the whole engine and use the whole engine without all the libraries. It is a glue framework (opposite of a stack framework).
A stack framework will have to use all installations files to be able to work. One of the best known in the stack category is SYMPHONY.
SYMPHONY is also implementing MVC and comes with lots of goodies that fasten the creation of a whole website: like an admin generator.
And you’ve got more: CakePHP, DooPHP, CodeIgniter, and much more ….
I do believe that it is best to use the right solution for the right problem and that it is not necessary to use one fo them to build a blog for example. Use WordPress instead. (yeah well, we don’t want to re invent the wheel you know)
So, don’t use a framework if you feel it’s an overkill. Using a framework implies to learn a new language and new techniques. It is a considerable investment of time when you come from the procedural.
So stick to the market, read what others say and be wise.
Let’s get going. I lately stepped into a very interesting php framework which revealed itself light, quick, extensible and easy to implement. Even if i think it is still young, it as enough maturity to be a good solution in many ways. Ladies and Gentlemen…the YII FRAMEWORK (pronounce veee).