MVC v. n-tier

Discussion in 'ASP .Net' started by Mark, Dec 30, 2004.

  1. Mark

    Mark Guest

    I'm having trouble envisioning when I would choose to develop an ASP.NET web
    application using the Model-View-Controller pattern rather than an n-tier
    approach (code-behind, business object, data access tier, SQL Server).

    I'd be interested to hear the situations that people have found MVC to be
    the "right" solution for an ASP.NET application.

    Thanks in advance.

    Mark
     
    Mark, Dec 30, 2004
    #1
    1. Advertising

  2. I think in ASP.NET application, n-tier is more applicable.
    Because there is some Microsoft Certified patterns for this architecture
    using .NET resources.

    But I prefer MVC. Because is more extensible.

    In general, you must allocate same time for developing your .NET application
    in both architecture. (Because in enterprise and complex J2EE application
    also you must expand the ActionServlet and develope it.)


    "Mark" wrote:

    > I'm having trouble envisioning when I would choose to develop an ASP.NET web
    > application using the Model-View-Controller pattern rather than an n-tier
    > approach (code-behind, business object, data access tier, SQL Server).
    >
    > I'd be interested to hear the situations that people have found MVC to be
    > the "right" solution for an ASP.NET application.
    >
    > Thanks in advance.
    >
    > Mark
    >
    >
    >
     
    =?Utf-8?B?QW1pcg==?=, Dec 30, 2004
    #2
    1. Advertising

  3. > I'm having trouble envisioning when I would choose to develop an ASP.NET
    > web
    > application using the Model-View-Controller pattern rather than an n-tier
    > approach (code-behind, business object, data access tier, SQL Server).

    Using a MVC pattern does not rule out an n-tier architecture. If your
    architecture will benefit the MVC pattern you should use it, but you should
    still use business objects, a proper data access layer, service facades and
    similar. Microsoft has a powerful MVC implemtation in the User Interface
    Process (UIP) application block
    (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/uipab.asp).
    I also suggest that you look at the other patterns and practies for
    application architecture and design found here
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/listpattandpract.asp
    for a complete overview of how to use UIP with an n-tier architecture.

    Anders Norås
    http://dotnetjunkies.com/weblog/anoras/
     
    Anders Norås [MCAD], Dec 30, 2004
    #3
  4. Mark

    Joerg Jooss Guest

    Mark wrote:
    > I'm having trouble envisioning when I would choose to develop an
    > ASP.NET web application using the Model-View-Controller pattern
    > rather than an n-tier approach (code-behind, business object, data
    > access tier, SQL Server).
    >
    > I'd be interested to hear the situations that people have found MVC
    > to be the "right" solution for an ASP.NET application.


    MVC does not contradict n-tier at all. MVC is a pattern to decouple your UI
    (presentation layer) from your model (domain layer). Layering is an approach
    to decouple subsystems in general (and much more). MVC is basically a recipe
    to enable proper layering.

    Cheers,

    --
    Joerg Jooss
    www.joergjooss.de
     
    Joerg Jooss, Dec 30, 2004
    #4
  5. You are right Mark ...... If we envision n-tier architecture as
    'UserInterfaceLayer+BusinessObjectsLayer+DAtaAccessLayer' then this UIP
    implementation of MVC is how you implement 'UserInterfaceLayer'.
    'BusinessObjectsLayer' and 'DataAccessLayer' are independent of whether we
    use UIP or not in 'UserInterfaceLayer'. So the best option according to me in
    such situation would be to use n-tier architecture with UIP in
    'UserInterfaceLayer'.

    refer fig 1.1 on
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/uipab-ch01.asp

    - Yatendra

    "Joerg Jooss" wrote:

    > Mark wrote:
    > > I'm having trouble envisioning when I would choose to develop an
    > > ASP.NET web application using the Model-View-Controller pattern
    > > rather than an n-tier approach (code-behind, business object, data
    > > access tier, SQL Server).
    > >
    > > I'd be interested to hear the situations that people have found MVC
    > > to be the "right" solution for an ASP.NET application.

    >
    > MVC does not contradict n-tier at all. MVC is a pattern to decouple your UI
    > (presentation layer) from your model (domain layer). Layering is an approach
    > to decouple subsystems in general (and much more). MVC is basically a recipe
    > to enable proper layering.
    >
    > Cheers,
    >
    > --
    > Joerg Jooss
    > www.joergjooss.de
    >
    >
    >
    >
     
    =?Utf-8?B?WWF0ZW5kcmEgS2hhbmRlbHdhbA==?=, Jan 3, 2005
    #5
  6. i m sorry for confusion in names in my previous post I agree with Joerg and
    express my views.

    "Joerg Jooss" wrote:

    > Mark wrote:
    > > I'm having trouble envisioning when I would choose to develop an
    > > ASP.NET web application using the Model-View-Controller pattern
    > > rather than an n-tier approach (code-behind, business object, data
    > > access tier, SQL Server).
    > >
    > > I'd be interested to hear the situations that people have found MVC
    > > to be the "right" solution for an ASP.NET application.

    >
    > MVC does not contradict n-tier at all. MVC is a pattern to decouple your UI
    > (presentation layer) from your model (domain layer). Layering is an approach
    > to decouple subsystems in general (and much more). MVC is basically a recipe
    > to enable proper layering.
    >
    > Cheers,
    >
    > --
    > Joerg Jooss
    > www.joergjooss.de
    >
    >
    >
    >
     
    =?Utf-8?B?WWF0ZW5kcmEgS2hhbmRlbHdhbA==?=, Jan 3, 2005
    #6
  7. Mark

    RWBradley

    Joined:
    May 7, 2010
    Messages:
    1
    Just a note. Most ASP.NET/Code Behind developers don't develop n-tire applications. In most cases every page with its associated code behind file has a dependency on the data layer. So at best you could, maybe, call this a two-layer application. MVC helps you in the seperation of concerns which is vital to building a robust n-tier application. One note, MS's default is to put the model in the presentation layer, the model should be part of the business layer.
     
    Last edited: May 7, 2010
    RWBradley, May 7, 2010
    #7
  8. Mark

    CmdJerry

    Joined:
    Mar 10, 2011
    Messages:
    1
    CmdJerry, Mar 10, 2011
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rob

    ASP v2 & 3-tier or 2-tier

    rob, Aug 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    421
    Steve C. Orr [MVP, MCSD]
    Aug 13, 2004
  2. NOSPAM

    2 tier to 3 tier?

    NOSPAM, Oct 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    446
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 14, 2004
  3. Steve Kershaw

    Setting up a new tier in a 3-tier system?

    Steve Kershaw, Mar 28, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    459
    Steve Kershaw
    Mar 29, 2006
  4. Shantanu Bhattacharya
    Replies:
    2
    Views:
    564
    Christopher Benson-Manica
    Dec 26, 2003
  5. Shantanu Bhattacharya

    Converting a 2-tier application to 3-tier application

    Shantanu Bhattacharya, Dec 25, 2003, in forum: C Programming
    Replies:
    2
    Views:
    467
    Christopher Benson-Manica
    Dec 26, 2003
Loading...

Share This Page