What are the advantages of using an MVC framework

2019-01-22 09:56发布

I am writing a comparison between 3 technology options for building our new website:

  • Wordpress
  • Drupal
  • An MVC framework

The boss is sure we should use Wordpress, but the site will be big, with many sections, subsections, pages, and complicated templates.

I'm finding it easy to compare WP + Drupal, but not so easy to state the additional advantages (over Drupal) of using an MVC framework.

So far I have:

  • Custom data storage, content types, semantics
  • APIs / REST
  • Separation of logic / UI
  • Convention, code structure

(Obviously some of the benefits will be different depending on the type of project. In this case it will be a large portal for a museum, with potential for some social stuff for visitors)

11条回答
Fickle 薄情
2楼-- · 2019-01-22 10:27

As someone who has worked on various home rolled CMS systems for the best part of the last decade my advice is don't roll your own. If you have some unique application then MVC is a nice way to code up web applications, but it's ease won't counterbalance the thousands of man hours spend building and millions of page hits of testing the OSS ones have.

Drupal is not only a nice CMS system but also is a pretty good framework for building bespoke web functionality, so you get a lot for free and only have to spend time working on what is unique to your site. (after you have learnt how to code on drupal systems)

查看更多
唯我独甜
3楼-- · 2019-01-22 10:29

Microsoft ASP MVC (for example) is a framework for building your websites on, Drupal is a content management system where you "design" your pages but don't have to write any code.

查看更多
劳资没心,怎么记你
4楼-- · 2019-01-22 10:33

The flexibility of a CMS has a limit, though with Drupal that limit is getting smaller. There is a learning curve to accomplish what you want, and it might not be the most elegant solution if you have to fudge it together with existing extensions. Of course you can always expand the functionality of any CMS yourself, but that may take more time than using a good framework in the first place.

I had this same dilemna recently, and after trying with Drupal, eventually went with the CodeIgniter MVC PHP framework instead. Probably worth investing a few days with a CMS first, to investigate if it's possible. If you then decide it'll be too difficult, use a MVC framework instead.

查看更多
叛逆
5楼-- · 2019-01-22 10:35

You can build a pretty extensible site based on WP or Drupal, but you may run into design limitations set based on what the frameworks were designed to do. Drupal/WP are content management systems at the core, so if you're not managing content, you're not using the framework effectively. If you find yourself building more and more code to get around these limitations, then you have cause to build from a scratch or use a lightweight framework.

I'm currently building a site with CakePHP MVC framework and I highly recommend it. IMHO, it satisfies all of your advantages.

查看更多
狗以群分
6楼-- · 2019-01-22 10:36

Drupal has MVC Layer, check out Drupal Prometheus @ http://www.drupalprometheus.org. It has most of the features of a modern MVC framework plus the power of Drupal CMS. We recently started using it on a project for our client.

查看更多
登录 后发表回答