开发者

Does using an MVC approach to (PHP-based) web applications necessarily mean that it will be more scalable than other approaches?

From what I understand MVC frameworks are pretty hefty (Zend,Cake,CodeIngniter), 开发者_运维百科so it almost seems contrary to talk about scalability and suggest using MVC.


Zend, Cake, CodeIgniter... they all come with a bunch of stuff you don't need. A basic MVC framework is simple, and does not need many files to work.

Also, applications built upon a MVC structure are no more or less scalable than other approaches may be, but may be more organized. It's subjective.


Although the point of MVC is simple - having data access (Model), GUI creation (View) and flow control (Controller) as separate components - it can be implemented in very different ways.

From a purely technical viewpoint, MVC has very little to do with computational scalability. It's more about the human factor and having a way to organize huge piles of code into meaningful sub-units that are much easier to understand.


I work with codeigniter every day and compared to the others mentioned it's very light weight.

You have to consider that you will likely not use a lot of the functionality provided in the largest frameworks so just because the files are there, it's not necessarily heavy unless you include lots of the files in your actual executing code.

You can help make your own code scalable in these situations by considering when and when not to use functionality provided by the framework. Learn PHPs built in functions well as they will almost always be faster than anything in a framework (because they are written in C).

A good framework should really just help you structure you code and give you extra functionality when you ask for it, not lumber your application with a lot of extra processing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜