Drupal as a MVC Framework?

peterVG - January 22, 2006 - 00:04

Hello Drupalites,

I am just beginning to test Drupal to see if it will meet my needs for an upcoming web application project. Since I already test- drove some of the new MVC frameworks (RubyOnRails, TurboGears, Django) it is helping me to conceptualize Drupal in a similar vein (as a MVC framework).

Some of you might find this interesting and might be able to tell me if this has any relevance or if I am completely wrong.

I've got a diagram up along with some background on how I arrived at this on my blog:
http://archivemati.ca/2006/01/21/drupal-as-a-mvc-framework/

Cheers,

Peter

I'm not a core developer so

John Hwang - January 22, 2006 - 01:38

I'm not a core developer so I can't say for sure, but I'd agree with your assessment...

JonBob wrote a great article about OOPism in drupal. I think you'll find it interesting.

One thing I like about your diagram is that it clearly shows that Drupal is so much more than just a MVC. Ruby on Rails, Django are basic frameworks and do not include Drupal's growing number of modules/components. It's the simple, clean design and the additional modules/CMS components is what I love about Drupal.

Notes: I'd probably not include flexinode/taxonomy in the model. Strickly speaking, path.module is an alias system so and doesn't provide the real message path to the appropriate controller. Also, if you're gonna consider CSS as part of the view, when why are we leave HTML or PHP out? Isn't Apache THE front controller?

Great job

Amazon - January 22, 2006 - 02:11

I am really glad your wrote this. I have been looking for a solid start to answer this question. I would want to sit down and see if your concepts of MVC and Drupal are true.

But what's important at the end of the day is how much you can do with the tools. Hopefully, you will chose Drupal because it's the most useful, buzz words be damned.

Cheers,
Kieran

updated diagram

peterVG - January 23, 2006 - 15:24

Amazon and John,

Thanks for you comments. I've updated my diagram based on the feedback I received here and in my blog comments.

See the bottom of comment #6 for v.2 of the diagram:
http://archivemati.ca/2006/01/21/drupal-as-a-mvc-framework/

Good for extending Content but anything else?

pearcec - February 5, 2007 - 21:01

I installed CCK which is interesting. It gives you a lot of flexibility for adding fields to nodes. But I don't see how this works as a generalized MVC. Seems to me it can act as an MVC with in the constructs of a CMS content but no further. I have certain data I need to model, and I don't see how having a content type for the data makes sense. Especially when it really isn't content at all. It doesn't need to be published. Maybe I am missing the point and you write modules for more flexibility. But at the point seems you are really beginning to stretch things a bit. You might as well just intergrate CakePHP in to Drupal.

Does anyone have an example of what they are doing that they could compare it to traditional MVC frameworks?

 
 

Drupal is a registered trademark of Dries Buytaert.