views:

56

answers:

3

Is it possible to integrate Zend Framework with already existing legacy web application? The application is written horribly using so called spaghetti code (no separation between presentation and application logic, PHP, HTML and SQL are all together). It is a very large application with hundreds of pages and forms.

Does it make sense to introduce a framework now or should we just continue with the spaghetti code? It is not realistic to rewrite the whole application using a framework because it would be too difficult. Moreover, we need to add some new functionality to the application and we have a deadline. Should we use a framework for all the new parts of the website that we need to add or should we just go with the way it has been programmed by developers that worked on it before us?

+1  A: 

I think you really could and should code the new bits of your application using a framework, and migrate the legacy bits to it whenever they bug. Refactoring is not difficult and can be done over a long period of time, and that could be a task when you feel bored. I advise you to read this very interesting article about refactoring : http://www.joelonsoftware.com/articles/fog0000000348.html , by Joël Spolsky

greg0ire
+1  A: 

yeah zf is a component framework so you can start buy creating new features using these new components or when you fix a bug to see if redoing it in zf will be faster.

I'm in a similar situation and what i started doing was creating a new site entirely and would embed these new features in certain pages within the old site (thru frames). This allowed me to code entirely in zf and replace the entire site piece by piece.

Brendon
+2  A: 

This excellent post by Chris Abernethy shows how to route all requests through ZF and have the legacy scripts handled by a LegacyController. New pages and content that you create can use the standard ZF MVC. And you can slowly migrate the legacy scripts into standard ZF MVC.

David Weinraub