Separation of concerns; MVC; why?

前端 未结 8 1827
栀梦
栀梦 2020-12-12 14:46

I\'m currently reading up on OO before I embark upon my next major project. To give you some quick background, I\'m a PHP developer, working on web applications.

On

8条回答
  •  忘掉有多难
    2020-12-12 15:19

    I don't know any good books on the MVC subject, but from my own experience. In web development for example, many times you work with designers and sometimes dbas. Separating the logic from the presentation allows you to work with people with different skill sets better because the designer doesn't need to much about coding and vice versa. Also, for the concept of DRY, you can make your code less repetitive and easier to maintain. Your code will be more reusable and make your job a lot easier. It will also make you a better developer because you will become more organized and think of programming in a different way. So even if you have to work on something that is not MVC, you might have a different approach to architecting the project because you understand the MVC concepts.

    I guess the tradeoff with a lot of MVC frameworks for large sites is that it may not be fast enough to handle the load.

提交回复
热议问题