How to deal with PHP design patterns

Source: Internet
Author: User
Have you ever participated in a comparison system project or application of the PHP design model? what is your idea of designing the system framework? Many people now talk about MVC, which is easy to maintain. Some people also introduce MVC into the php design pattern, but I want to ask if MVC is really suitable for php? I always think it is awkward to implement MVC in PHP. after all, the PHP design pattern in a PHP file
Have you ever participated in a comparison system project or application? what is your idea of designing the system framework?

Many people now talk about MVC, which is easy to maintain.

Some people also introduce MVC into the php design mode,

But I want to ask if MVC is really suitable for php?

I always think that the implementation of MVC in PHP is awkward. after all, a program in the PHP file is released after it is executed, and the program in java/c # is resident in the memory, so every call to the Module layer in PHP starts from the beginning, so the overhead is not very high?

In addition, I think PHP implements MVC. the Controller here is almost dispensable. If you have such a design, you will certainly feel this way.

What are your comments?

------ Solution --------------------
MVC is a software architecture Model that divides a software system into three basic parts: Model, View, and Controller ).
Since it is an architecture model, there is no question about whether it is suitable for a language. He is just a way of thinking, a way of looking at things
MVC is not as easy to maintain as you said. On the contrary, because of its complicated internal principles, it takes some time to think about it. Developing an MVC-mode architecture project will have to spend considerable time considering how to apply the MVC-mode to applications. at the same time, the model and view must be strictly separated, this also makes it difficult to debug the application. Each component must be thoroughly tested before use. In addition, because the MVC mode divides an application into three parts, this means that the same project will contain more files than before.

The Controller is dispensable.Is C or MVC missing?
Every call to the Module layer starts from the beginning, so the overhead will not be great?Is there no overhead without using MVC? Do the required functions always require code implementation?

------ Solution --------------------
In fact, mvc is currently in use in mainstream development languages.

In fact, the main role of mvc is not to improve performance and acceleration. After all, the framework has volume and loss.

I personally think that mvc is mainly used for coding, maintenance, and development.

------ Solution --------------------
On the first floor and the second floor, I spoke very well. there is a rational concept, mainly an idea, which is easy to develop and maintain later. of course, I also felt awkward at the beginning. why, complicate a simple task!
------ Solution --------------------
#5

Some logic processing is completed in the Controller. how can this problem be negligible.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.