Friday, 18 January 2013

PHP Frameworks : What is Zend Framework , and what is MVC?

First things first , What is a framework ?   In real life framework refers to a supporting structure , which helps support something of larger dimensions . In other work a skeleton is to a body what a framework is to a structure ! So in a nutshell what does a framework do ? IT SUPPORTS A LARGER STRUCTURE !!


So what are software frameworks ?

All of you whether you are a coder or not must have come across frameworks . For instance the dot net framework (.NET ) being one of them . Some of you geeks or experienced coders might also have come across other frameworks for python , java or other programming languages . So what is a software framework ? The most simplest way to explain this is :- A software framework is something which gives you lots of pre-baked code , makes your project more structured and hides your implementation details , and in some cases it saves a lot of time . A more nerdier way to put it would be :- It provides various layers of abstraction along with which it provides a pleothra of support programs, API's(Application Programming Interface) etc . Frameworks are not only limited to web applications , there are frameworks for other platforms too . 

Should I Use a framework ?  

Whether to use a framework or not , it actually depends on the size of your project , suppose you have in mind a website which is just about a few pages and uses a single sql table or so , then it is best not to use a framework since it will only add to the size , and a project of such a small scale does not need that much of structuring . You should use a framework when , number one , the project is of a large scale . Two , initially you have just a few visitors , but you know that there will be a substantial increase over time . Three you want scalability !

What is Zend ?



Zend framework is an open-source , object-oriented application framework . It was implemented using PHP5 and is licensed under the new BSD license . It implements the model-view-controller(MVC) pattern . We can use zend for a large number of projects other than using it in application frameworks . I am using Zend for my current project and it's really easy to setup whether you are a windows fan or a linux buff . Also you have total control of your code . Say you want to use only a certain fragment of what zend has to offer , then you can easily use that along with your code or any other api . However it has some issues when it comes to forms . You can't design the form the way you want , you have to bypass the output using php's string functions and so on .


What is MVC ?

MVC is not a new term . Like many great things in the history of computers , it's origin can be traced back to Xerox's PARC ( Trygve Reenskaug) during the late 70's . MVC (Model-view-controller) is a software architecture pattern consisting of three main components as is evident from it's name -> Models , Views and controller . Speaking in terms of web development , view will contain your ultimate html output , that is the one which will be presented to the user . Controller is the one who is responsible for making changes to the databases , or updating a view etc . A model mediates between the views and controllers , it notifies the change in state in either of the view or controller to the other one .


In the next post i will describe the installation process for zend , till then take care !! cheers !!

Download Zend FrameWork here :- Zend FrameWork Download








2 comments: