MVC design pattern and layers

Last post 07-02-2009 5:00 AM by vivek_iit. 2 replies.

Sort Posts:

  • MVC design pattern and layers

    07-02-2009, 2:47 AM
    • Member
      2 point Member
    • praful_udade
    • Member since 11-17-2008, 9:07 AM
    • Posts 3

    I am using MVC design pattern in my web application. I would like to know if I am using MVC design pattern, then can I consider Model as business objects, Views as Presentation layer and Controllers as Business logic? Please provide me more details

  • Re: MVC design pattern and layers

    07-02-2009, 4:04 AM
    Answer
    • Participant
      846 point Participant
    • Revdoniv
    • Member since 06-29-2009, 6:58 AM
    • Posts 168

    You are right.

    But people argue with this and they are right most of times

    Becoz Asp.net doesn't implement the MVC pattern exactly. but looks like it implements the same design.

    so to clear all these arguments ASP.Net MVC has come up.

    In ASP.Net MVC the structure of the project is divided into Models,Views,Controllers and the requests come to the Controller Actions or say Methods.

    There are some books and articles online which will explain in detail of MVC design which emerged some decades back.

    I suggest you should not much worried about if your design is MVC or not. Current asp.net design is fine to go along with your Bussiness layers and DataAccess layers etc...

    If you really need to show up a project in MVC design and in .Net then develop application in Asp.Net MVC and it is easy to learn also.

    Have a Great day!

    Regards

    Revdoniv

    Please mark this as "Answer" if it helps you
  • Re: MVC design pattern and layers

    07-02-2009, 5:00 AM
    Answer
    • All-Star
      17,710 point All-Star
    • vivek_iit
    • Member since 06-18-2006, 2:13 PM
    • New Delhi
    • Posts 3,171
    • TrustedFriends-MVPs

    praful_udade:
    I would like to know if I am using MVC design pattern, then can I consider Model as business objects, Views as Presentation layer and Controllers as Business logic

    While working on an MVC project, I treat all three of them (mode view and controller) as a part of the UI tier only. I have my own BL layer, my own DAL and DTOs. Then I put a MVC "wrapper" on them in order to use an MVC architecture (using ASP.NET MVC), or a web forms based project to use traditional web based programming.

    So Business logic should ideally be kept "separate" from MVC, the controller should just use the BL layer and present data to the Views accordingly using DTOs as the model.

    HTH,

    Vivek

Page 1 of 1 (3 items)