Php – File Structures — Why use (Zend) MVC

ArchitecturePHPzend-framework

I'm relatively new to PHP and have been writing a project using what I believe is a fairly basic file architecture – all files and sub-folders within one main site folder accessed separately. Within the project, I've been using the Zend Framework as more of a library than an actual framework. I'm happy with Zend and using it like this makes things very easy. However, I have recently been starting to dread the maintenance and expansion that may be required with the project (something I should have thought about before, I know). I have been doing a bit of research and looking into using the Zend MVC rather than the basic structure as it appears this would help to remedy that fear. However, it would mean a lot of backtracking in the project (not a huge deal, just a little frustrating).

What I'm wondering is if there are any other reasons why I should take the time to switch away from the basic structure over to an MVC architecture, or if there are any other file structures I should be considering?

Best Answer

The first reason is that MVC has been shown to be effective in being able to maintain your code.

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

The second reason, which I believe is part of the first one, is that it allows developers to come in behind you and already know what the basics are. Instead of searching through your project and trying to find out how it works, they already know.

I might suggest Kohana as a good framework to use. http://kohanaphp.com

Related Topic