none
MVC VS N-Tiers RRS feed

  • Question

  • I am studying Framework and Pattern.  I am a bit confused between MVC and N-Tiers so I want to hear from you experts.

    When I have, say, a 3-tier application, can I apply also the MVC?  It seem to me that they actually telling similar things but looking from different views.  Does the Clients-Side Business Object(CSBO) the same as the Model in MVC?  Are the Controllers in MVC the listeners/handlers of CSBO?  If I raise events from the Model, I can actually not only control/reflect from the View(say, I can listen from the data tier also), isn't it?

    Thank you for all comment.

    Sunday, November 5, 2006 12:22 AM

Answers

  • Hi Kennon,

       The answer to your question "When I have, say, a 3-tier application, can I apply also the MVC?" is YES

       A 3-tier application it's deployed in 3 different processors/processes: such division is, most of all, physical (so watch your frequency of tier-crossing bcs it could affect the application performance, despite its multiple benefits). Usually the tiers are:

    • The Front-End environment (typically a browser, a desktop application in a desktop terminal)
    • The Middleware (an application server usually accessible thru a web protocol-based process)
    • The Back-End, ranging from databases to large mainframe environments

       In UML terms, a 3-tier application is better depicted with a Deployment diagram

       The MVC architecture pattern establishes a division of responsibilities between components at a use case level, without mentioning physical boundaries (in deployment terms). Here you can find

    • The Model, which represents the present status of the domain entities (without specifying where is that status, whether in memory, whether in a database, XML files set or a mainframe system)
    • The View, responsible to capture user input and to display outcomes based on the Model status
    • The Controller, which reacts to events generated in the View, motivating changes in the domain status (I mean, changes in the Model). Changes subsequently displayed in the View

       In UML terms, the MVC architecture pattern is well depicted with a Sequence Diagram

     

       So, as you can see, both models decompose applications from different perspectives and, sure, you can have both models present in a same application. I invite you to read this article we published a month ago at SkyScrapr:

     

       Hope it helps you to better understand!!  

    Sunday, November 5, 2006 5:33 PM

All replies

  • i personally think that the in MVC pattern, the controller is just like the input, view as output, model for mid tier processing, it is different from 3-tier app, the input source is not exactly a people/device/software process or data source, the n-tier application actually can be seen as some kind of 3-tier owned by different autonomous stakeholder of the system, for example,since they are about integration, there are the blackboard pattern/share database/or using a broker to access the data by multiple different process as the mid-tier but looks like 3 tier, or many mid-tier or data tier link together by different owners but in order to function in a seamless way, they have to finally integrate, and you can see all the integrated processes or components in logic or data tier as one data tier or logic tiers

    this is just as a tip

    Sunday, November 5, 2006 5:14 PM
  • Hi Kennon,

       The answer to your question "When I have, say, a 3-tier application, can I apply also the MVC?" is YES

       A 3-tier application it's deployed in 3 different processors/processes: such division is, most of all, physical (so watch your frequency of tier-crossing bcs it could affect the application performance, despite its multiple benefits). Usually the tiers are:

    • The Front-End environment (typically a browser, a desktop application in a desktop terminal)
    • The Middleware (an application server usually accessible thru a web protocol-based process)
    • The Back-End, ranging from databases to large mainframe environments

       In UML terms, a 3-tier application is better depicted with a Deployment diagram

       The MVC architecture pattern establishes a division of responsibilities between components at a use case level, without mentioning physical boundaries (in deployment terms). Here you can find

    • The Model, which represents the present status of the domain entities (without specifying where is that status, whether in memory, whether in a database, XML files set or a mainframe system)
    • The View, responsible to capture user input and to display outcomes based on the Model status
    • The Controller, which reacts to events generated in the View, motivating changes in the domain status (I mean, changes in the Model). Changes subsequently displayed in the View

       In UML terms, the MVC architecture pattern is well depicted with a Sequence Diagram

     

       So, as you can see, both models decompose applications from different perspectives and, sure, you can have both models present in a same application. I invite you to read this article we published a month ago at SkyScrapr:

     

       Hope it helps you to better understand!!  

    Sunday, November 5, 2006 5:33 PM
  • Sample of combining MVC at the UI layer with an N-tier architecture :

    http://www.codeplex.com/WPFMVC

     

     

    Thursday, May 1, 2008 10:14 PM
  • I wrote an article about this exact question.
    http://allthingscs.blogspot.com/feeds/posts/default
    Sunday, March 6, 2011 2:09 AM
  • if you are considering of using mvc asp.net  can be used only for asp.net 4.0 web application. 
    Sunday, March 13, 2011 1:31 PM