views:

57

answers:

4

Hi experts,

we have an old large application that was not built on any framework. However now we want to transfer it to a php framework. Its a new area for us so we are not sure what it takes to transfer the older application to a framework like Zend? Any help will be appreciated. thanks

A: 

Totally dependent on the makeup of the old framework.

Try to find components in Zend/CodeIgniter/CakePHP that closest resemble the functionality of the components in the old framework, then choose that library.

Finbarr
+2  A: 

Go sit and write it from scratch using framework. That's all.

Col. Shrapnel
That may seem like a lot of work but I also think, it's a good idea. Developing from scratch will probably not take that much longer than porting the existing code but you'll end up with a much cleaner code base if you rewrite it completely.
Techpriester
A: 

As far as I know, Zend Framework has an advantage as it can be used as a library.

You may work iteratively, adding for instance only the Zend_Db layer, then progressively adding other layers (Auth, MVC, etc.).

The point is to be able to test and validate simple functionnalities, rather then change all at once, and fight numerous bugs.

Rodolphe
+3  A: 

You have three options:

  1. Rewrite the application from scratch using the framework.

  2. As another poster suggested, gradually start introducing ZF components into your application, the DB and View layers in particular would be good candidates. MVC would likely be the trickiest bit if your old app is large.

  3. Create your new ZF application, add a 'legacy' module to it and put all of your old application code into this module. Route all requests to this module and get it to setup and load up whichever part of your old application needs to serve the request. You then gradually start adding ZF modules to replace parts of your old application (adjusting your routes accordingly), until eventually there's nothing left in 'legacy' and you can remove it.

Exactly which of these is the best option for you depends completely on your application. In my experience, option 1 will take the least dev time, option 2 the most and option 3 somewhere in the middle. With options 2 and 3 you have a transitional period where you're gradually introducing the new stuff, whereas with option 1, one day you just migrate all the data across and flick the switch.

The 'use at will' architecture of ZF is what makes option 2 possible, with other PHP frameworks you probably only have options 1 and 3.

Good luck!

Tim Fountain