Code Explosion

Code that explodes conventions

Drawback of MVC pattern I have noticed

I’m a big fan of MVC pattern. It’s definitely an excellent architectural pattern and it has done splendid job in last few years. But again, it has some drawback.

The first thing, it does not provide user boundary explicitly. A controller action normally renders a view. But it has no idea about user activity. In general case, user activity spans more than one view and there may have some intermediate state. In this case, developer needs to manage navigation between the different sub views coupling several controllers. It has far-reaching consequence I think.

Secondly, I must say little bit about presentation layer that is the views. It has improved a lot but I think it’s still old-fashioned. Developer needs to write raw html code by hand. It can’t interact business process natively. Views require dedicated code coupling multiple controllers that act for business process. I’m not saying it’s bad, but definitely it’s an issue to ponder.

Thirdly, the model level, MVC doesn’t provide specific framework to manage data object, I would say, it just contains some entity. How they will interact with views, how they will communicate with physical data, there is no specific direction. Sometime they are only created for specific views and something for accessing physical data eventually they are blended with business process. Developer may sometime get confused, they need to develop own implementation.

Personally I like and use MVC pattern specially asp.net mvc3 and spring MVC. It’s really a good pattern. But I would say, it’s quite complex and not suitable for thin application development.

About these ads

3 Comments on “Drawback of MVC pattern I have noticed

  1. Collin Rusk
    May 23, 2012

    I definitely agree that MVC is not suited a RAD app. If you’re doing RAD, I wouldn’t use Java or ASP.Net. PHP or Rails is a better choice. MVC patterns seems best suited for complex applications.

  2. Bazlur Rahman
    May 24, 2012

    That’s what I meant. :)

  3. Maeenul
    July 3, 2012

    Some of the problems you mentioned can be addressed using MVP or MVVM. In more complex scenarios, you might need to mixup C and P, I mean both presenter and controller. MVP itself has some problems which can be addressed using MVVM. Again, controller might be integrated with MVVM if you see appropriate.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Information

This entry was posted on May 23, 2012 by in Design pattern, Technology Thoughts and tagged , , .

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 291 other followers

RSS Jenkov.com

  • Java Exception Handling - New book published!
    Download this book for free from Amazon until and including march 1st! Exception handling is an aspect of Java development that has not received as much attention as it deserves. If you do not have exception handling under control, you risk that your application or data ends up in an unhealthy state, which can have serious consequences. That is why I wrote t […]
  • HTML4 Compressed - Kindle book published
    In this day and age it should be easy and cheap to learn HTML4, which everyone needs to learn in order to learn HTML5. Therefore I published this Kindle book which explains HTML4. The parts of HTML4 that is not removed in HTML5, that is.
  • jQuery Compressed - Updated
    I have updated the jQuery Compressed book to be compatible with version 1.9.1 of jQuery.
  • Displaying SVG in Browsers
    The SVG tutorial has been updated, showing how to include SVG in HTML pages using the img HTML element, or the SVG element.
  • Maven Tutorial.
    This Maven tutorial explains the core concepts of Maven which are important to understand for new Maven users.

my tweets

Follow

Get every new post delivered to your Inbox.

Join 291 other followers