Does Drupal comply with the MVC paradigm? - model-view-controller

Drupal is frequently referred as a Content Management Framework, does it comply with the MVC paradigm? If it does, how Drupal implements MVC?
Thanks.

No, Drupal follows the PAC (Presentation-Abstraction-Control) model rather than MVC. There is an excellent blog post explaining this at Larry Garfield's site.

Drupal 8 now incorporates Symfony components. So this means while a Drupal 8 application is not an MVC framework/CMS as a whole, Drupal 8 modules are implemented in an MVC pattern with controllers, routes and Twig templates for Views.

No it does not.
You can however develop software using mvc architecture and there are even modules to facilitate that, but the system it self does not. maby it will in the future.
but some fundamental concepts of drupal, like the hooks, are conflicting with the mvc paradigm

No, drupal is not an MVC framework at all.

Related

ASP.NET MVC 3 - How to Reuse Solution?

What's the best way to structure the base functionality of an ASP.NET MVC 3 solution so it can be reused in subsequent solutions? For example, I'm going to develop a basic skeleton MVC app with user registration using email verification, enhanced users/right/roles, blogging with comments, and a forum. I understand maintaining the business logic in class libraries but how about the controllers and views? Do I basically have to just copy and paste my base solution to create each of my new solutions?
Creating a Custom ASP.NET MVC Project Template
templify

.NET 4.0 MEF. Pluggable ASP.NET MVC 3.0 Approach

I am going to start new MVC 3.0 .NET 4.0 application.
I want to implement each component for my web site once and simply reuse it then for another web sites i going to build.
Currently i am looking the best practice i can use to achieve my goal.
I did some research and found that I may get a lot of advantages using MEF.
I found interesting MEF MVC solution called plugable MVC http://www.thegecko.org/index.php/2010/06/pluggable-mvc-2-0-using-mef-and-strongly-typed-views.
Is it really worth to use such kind of approach(Plugabble MVC) of building MVC apps?
Advantages disadvantages of pluggable MVC?
May be somebody may suggest something else?
What specific problem are you trying to solve? MVC is a very extensible and pluggable framework as it is. I would say that for a simple site MEF is not necessary. Please provide more information on the issues you are running into with the stock MVC framework.

ASP.NET WebForms vs MVC [after VS2010/.NET 4.0 announcement]

Two of the biggest advantages of MVC over webforms were non-existent viewstate and URL routing. VS2010 and .NET 4.0 incorporates built-in URL routing for Webforms as well as better control for viewstate.
I advocate use of MVC for extranet sites due to the MVC design pattern and its general lightweight nature but in light of this new announcement has Webforms closed the gap? Why would you still pick MVC over Webforms?
Thanks
You're forgetting about 2 main advantages of MVC: better control over generated HTML and better support for test-driven development.
I'd say that normally implementing a site using ASP.NET WebForms would require less effort that implementing exactly the same with MVC.
MVC gives you more control, but it also requires more expertise and effort.

What is an MVC framework and why is it necessary/useful?

I know that an MVC framework allows you to separate business logic, data base access and presentation, but why do we need a framework to do this.
Can't we just keep our classes separated, perhaps using different packages/folders for the model, view and controller classes?
In my opinion the thing you are talking about is the MVC pattern and not a specific framework. Of course you can go and keep all your classes within one project and still use the MVC pattern, as you have all your UI code in the views, the logic in the controllers, ...
A MVC framework on the other hand makes it easier for you to use this pattern. It may provide some base classes for controllers and a mechanism for the communication between view and controller.
I don't know if you are familiar with ASP.NET MVC. The framework itself is very small, but it helps you developing an application with the MVC pattern, as you don't have do think about the previously decribed areas...
Hope this helps
An MVC framework is a framework written to split up the the business logic, database access and presentation.
This is very useful in most web applications, and now lately into software/desktop applications.
This is due to the fact that following the MVC model, your code will be much clearer, cleaner and you keep your application DRY (Do not Repeat Yourself).
You can write your own classes and separate them into Model, View and Control. But again, you will need a framework to help you in accomplishing certain tasks. Like a List control in ASP.NET, or PHP framework being able to help you translate text between languages and so on. (Oh why reinvent the wheel?!)
MVC and framework is a different thing. MVC is just an architectural pattern, which can be applied with any project, with or without framework.
So you don't need a framework to do this. You can separate them by yourself. :)
MVC stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner than the traditional ASP.NET web development. Web applications developed with ASP.NET MVC are even more SEO (Search Engine) friendly.
Developing ASP.NET MVC application requires Microsoft .NET Framework 3.5 or higher.
Model:
MVC model is basically a C# or VB.NET class.
A model is accessible by both controller and view.
A model can be used to
pass data from Controller to view.
A view can use model to display
data in page.
View:
View is an ASPX page without having a code behind file.
All page specific HTML generation and formatting can be done inside view.
One can use Inline code (server tags ) to develop dynamic pages.
A request to view (ASPX page) can be made only from a controller’s action method
Controller:
Controller is basically a C# or VB.NET class which inherits system.mvc.controller.
Controller is a heart of the entire MVC architecture.
Inside Controller’s class action methods can be implemented which are responsible for responding to browser OR calling views.
Controller can access and use model class to pass data to views
Controller uses ViewData to pass any data to view.
MVC is a code organization architecture style to organize your code-logic in a meaningful way for web applications. As a programmer I have almost puked when I have inherited other people's code when their code logic is all over the place and following their web application code turns into following a rabbit down the gutter hole. Why MVC? hmm.. well why should I use a filing cabinet or folders to organize my plethora of paper and not just have my papers stashed in a large pile and have others figure how they connect to each other. It increases code readability. With MVC it becomes very easy to follow code logic since you are following standard structure for a web application. Business logic is separated out from UI. Easier to delegate work decouple work on a project.
You can of course approach it yourself by segregating your classes. A framework supplies common scaffolding that you wouldn't have to build yourself. But it will also impose some structure on your code. You'll have to evaluate whether the framework helps more than it hurts.
You are correct, there are strategies that you can implement to help with separation of concerns without using MVC.
Microsoft's ASP.NET MVC framework is one strategy that can be employed, and that is what I think you are asking about.
This MVC framework makes such separation of concerns easy.
The other major advantage of MVC is testability - (depends on whether you believe in unit testing - I do).
The MVC framework ensures that all orchestration logic is on your controllers and through the FormControls collection allows full unit testing of all aspects of your application except for how it is presented.
As the MS MVC framework encourages adherence to common rules and structure of the application which should lead to greater maintainability.
The major downside of MVC is the code-in-front code weaving required for presentation, but this can be easily overcome.
Perhaps this is just a linguistic thing. I've seen "frameworks" referring to themselves as a DSL -- Domain Specific Language.
And you don't need a framework But here's something to consider: You already know for a web app you're going to want to do a few common things... route URLs, render pages, etc. Why re-write it all? For other problem domains you'll have generic things to do as well.
Hai Friends There are somemany types of architecture frame work has been there,firstly i know 2tier and 3 tier frame work ,the 3 tier and mvc ,entity framework are same but in different name's,so study a good background in any one architecture there fore if you went to any multinational companies ,you can easly score/highlight to your carrer.
Model View Controller or MVC as it is popularly called, is a software design
pattern for developing web applications. A Model View Controller pattern is made
up of the following three parts:
**Model** - The lowest level of the pattern which is responsible for maintaining data.
**View** - This is responsible for displaying all or a portion of the data to the user.
**Controller** - Software Code that controls the interactions between the Model and View

Are all MVC platforms the same?

In the future I will be working with MVC with java/j2ee,hibernate,and more, but for now I have asp.net, php, python, ruby, etc. If I learn how to use MVC asp.net or MVC with a php framework, or RoR, will that help me with the Java version? I don't want to wait until I start the java project before I start really learning how to use MVC, but if the .net or php versions of mvc are so different that it will be a major relearning, then I might not use the non-java mvc frameworks.
In short, is learning MVC on one platform good for learning it on all platforms? I realize the tools and languages will be different, but my question is for general knowledge.
I hate working on things in a "special" way for a one time project that will show no future benefit.
Thank you.
MVC is all about splitting your application into 3 major parts. The model which contains most of the code that interacts with your database, the controller which accesses the model and gets the data it needs which then gets passed to the view which renders this for the user to see.
No matter which technology/framework you choose this basic principle will remain and only the technology used behind it will change.
For example if you went the PHP route and choose symfony as your web framework you would be using Doctrine or Propel as your model/ORM. If you used JBoss Seam you would be using Hibernate/JPA as your ORM and EJBs as your controllers.
Even though these 2 frameworks follow the same rules when it comes to separating logic from design they also require you to learn very different concepts to utilize them correctly.
For instance in JBoss Seam, the framework relies heavily on your knowledge of scope and stateless and stateful session beans where in symfony there is no such concept (sort of).
So whatever route you choose, there is still much to learn after you've mastered the concept of MVC.
MVC is a basic software architectural pattern. It's just an abstract concept. Its specific implementations will differ based on the language and platform you are using (as does everything), but the basic concepts remain the same.
So in a word: yes. Learn what MVC means as a concept and you'll be able to transfer that knowledge between platforms and technologies.

Resources